feat(cli): Expose --photo-quality to control the quality of the converted images

pull/99/head
Romain 6 years ago
parent 8f76013539
commit a5740fb94e

@ -38,6 +38,12 @@ const OPTIONS = {
type: 'number',
'default': 1000
},
'photo-quality': {
group: 'Output options:',
description: 'Quality of the resized/converted photos',
type: 'number',
'default': 90
},
'download-photos': {
group: 'Output options:',
description: 'Target of the photo download links',
@ -230,6 +236,7 @@ exports.get = (args) => {
title: opts['title'],
thumbSize: opts['thumb-size'],
largeSize: opts['large-size'],
photoQuality: opts['photo-quality'],
downloadPhotos: opts['download-photos'],
downloadVideos: opts['download-videos'],
downloadLinkPrefix: opts['download-link-prefix'],

@ -91,8 +91,8 @@ function modifiedDate (filepath) {
function getActionMap (opts) {
const thumbSize = opts.thumbSize || 120
const largeSize = opts.largeSize || 1000
const thumbnail = { height: thumbSize, width: thumbSize }
const large = { height: largeSize }
const thumbnail = { height: thumbSize, width: thumbSize, quality: opts.photoQuality }
const large = { height: largeSize, quality: opts.photoQuality }
return {
'fs:copy': (task, done) => fs.copy(task.src, task.dest, done),
'fs:symlink': (task, done) => fs.symlink(task.src, task.dest, done),

Loading…
Cancel
Save