New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sharp-cli

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sharp-cli - npm Package Compare versions

Comparing version 1.10.0 to 1.11.0

.nyc_output/9213d82b-0219-4240-8390-51771df40c87.json

2

.nyc_output/processinfo/index.json

@@ -1,1 +0,1 @@

{"processes":{"8c8cb6a3-b369-4022-8309-e67255b66c9a":{"parent":null,"children":["da6153a0-2535-4f1b-94e3-74c0a385ff91"]},"da6153a0-2535-4f1b-94e3-74c0a385ff91":{"parent":"8c8cb6a3-b369-4022-8309-e67255b66c9a","children":[]}},"files":{"/Users/vseventer/Projects/sharp-cli/lib/cli.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/lib/constants.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/lib/queue.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/channel-manipulation/bandbool.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/blur.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/boolean.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/compositing/composite.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/convolve.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/channel-manipulation/ensure-alpha.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/resizing/extend.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/resizing/extract.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/channel-manipulation/extract.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/flatten.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/flip.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/flop.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/gamma.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/colour-manipulation/greyscale.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/channel-manipulation/join.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/linear.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/median.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/modulate.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/negate.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/normalise.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/compositing/overlay-with.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/recomb.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/channel-manipulation/remove-alpha.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/resizing/resize.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/rotate.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/sharpen.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/threshold.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/colour-manipulation/tint.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/output.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/colour-manipulation/tocolourspace.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/cmd/resizing/trim.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/lib/convert.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"],"/Users/vseventer/Projects/sharp-cli/lib/index.js":["da6153a0-2535-4f1b-94e3-74c0a385ff91"]},"externalIds":{}}
{"processes":{"9213d82b-0219-4240-8390-51771df40c87":{"parent":null,"children":[]}},"files":{"/Users/vseventer/Projects/sharp-cli/lib/cli.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/lib/constants.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/lib/queue.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/channel-manipulation/bandbool.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/blur.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/boolean.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/compositing/composite.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/convolve.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/channel-manipulation/ensure-alpha.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/resizing/extend.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/resizing/extract.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/channel-manipulation/extract.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/flatten.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/flip.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/flop.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/gamma.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/colour-manipulation/greyscale.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/channel-manipulation/join.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/linear.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/median.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/modulate.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/negate.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/normalise.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/recomb.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/channel-manipulation/remove-alpha.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/resizing/resize.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/rotate.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/sharpen.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/operations/threshold.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/colour-manipulation/tint.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/output.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/colour-manipulation/tocolourspace.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/cmd/resizing/trim.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/lib/convert.js":["9213d82b-0219-4240-8390-51771df40c87"],"/Users/vseventer/Projects/sharp-cli/lib/index.js":["9213d82b-0219-4240-8390-51771df40c87"]},"externalIds":{}}
# Changelog
## 1.11.0 (November 2, 2019)
* Added support for HEIF images.
* Added [`--hcompression`](https://sharp.pixelplumbing.com/en/stable/api-output/#heif) option.
* Added [`--premultiplied`](https://sharp.pixelplumbing.com/en/latest/api-composite/#composite) option.
* Added [`--reductionEffort` and `--smartSubsample`](https://sharp.pixelplumbing.com/en/stable/api-output/#webp) options.
* Fixed bug with output directories ([#16](https://github.com/vseventer/sharp-cli/issues/16)).
* Removed [`overlayWith`](http://sharp.pixelplumbing.com/en/v0.21.3/api-composite/#overlaywith) command.
* Updated `fs-extra`, `mocha`, `sharp`, `sinon`, and `standard` dependencies.
## 1.10.0 (June 26, 2019)

@@ -4,0 +13,0 @@ * Added [`composite`](http://sharp.pixelplumbing.com/en/stable/api-composite/#composite) command.

@@ -56,3 +56,3 @@ /*!

const handler = (args) => {
return queue.push([ 'bandbool', (sharp) => sharp.bandbool(args.operator) ])
return queue.push(['bandbool', (sharp) => sharp.bandbool(args.operator)])
}

@@ -59,0 +59,0 @@

@@ -40,3 +40,3 @@ /*!

// Command handler.
const handler = (args) => queue.push([ 'ensureAlpha', (sharp) => sharp.ensureAlpha() ])
const handler = (args) => queue.push(['ensureAlpha', (sharp) => sharp.ensureAlpha()])

@@ -43,0 +43,0 @@ // Exports.

@@ -56,3 +56,3 @@ /*!

const handler = (args) => {
return queue.push([ 'extractChannel', (sharp) => sharp.extractChannel(args.band) ])
return queue.push(['extractChannel', (sharp) => sharp.extractChannel(args.band)])
}

@@ -59,0 +59,0 @@

@@ -64,3 +64,3 @@ /*!

const handler = (args) => {
return queue.push([ 'joinChannel', (sharp) => {
return queue.push(['joinChannel', (sharp) => {
return sharp.joinChannel(args.images, { density: args.density })

@@ -67,0 +67,0 @@ }])

@@ -40,3 +40,3 @@ /*!

// Command handler.
const handler = (args) => queue.push([ 'removeAlpha', (sharp) => sharp.removeAlpha() ])
const handler = (args) => queue.push(['removeAlpha', (sharp) => sharp.removeAlpha()])

@@ -43,0 +43,0 @@ // Exports.

@@ -40,3 +40,3 @@ /*!

// Command handler.
const handler = (args) => queue.push([ 'greyscale', (sharp) => sharp.greyscale() ])
const handler = (args) => queue.push(['greyscale', (sharp) => sharp.greyscale()])

@@ -43,0 +43,0 @@ // Exports.

@@ -52,3 +52,3 @@ /*!

// Command handler.
const handler = (args) => queue.push([ 'tint', (sharp) => sharp.tint(args.rgb) ])
const handler = (args) => queue.push(['tint', (sharp) => sharp.tint(args.rgb)])

@@ -55,0 +55,0 @@ // Exports.

@@ -56,3 +56,3 @@ /*!

const handler = (args) => {
return queue.push([ 'toColourspace', (sharp) => sharp.toColourspace(args.colourspace) ])
return queue.push(['toColourspace', (sharp) => sharp.toColourspace(args.colourspace)])
}

@@ -59,0 +59,0 @@

@@ -75,2 +75,6 @@ /*!

},
premultiplied: {
desc: 'Avoid premultiplying the image',
type: 'boolean'
},
tile: {

@@ -96,7 +100,7 @@ desc: 'Repeat the overlay image across the entire image with the given gravity',

const handler = (args) => {
const [ top, left ] = args.offset || [ ]
const [ width, height, channels, background ] = args.create || [ ]
const [top, left] = args.offset || []
const [width, height, channels, background] = args.create || []
// @see http://sharp.pixelplumbing.com/en/stable/api-composite/#composite
return queue.push([ 'composite', (sharp) => {
return queue.push(['composite', (sharp) => {
return sharp.composite([{

@@ -109,2 +113,3 @@ input: args.image,

left,
premultiplied: args.premultiplied,
tile: args.tile,

@@ -111,0 +116,0 @@ top

@@ -55,3 +55,3 @@ /*!

const handler = (args) => {
return queue.push([ 'blur', (sharp) => sharp.blur(args.sigma) ])
return queue.push(['blur', (sharp) => sharp.blur(args.sigma)])
}

@@ -58,0 +58,0 @@

@@ -64,3 +64,3 @@ /*!

const handler = (args) => {
return queue.push([ 'boolean', (sharp) => sharp.boolean(args.operand, args.operator) ])
return queue.push(['boolean', (sharp) => sharp.boolean(args.operand, args.operator)])
}

@@ -67,0 +67,0 @@

@@ -76,3 +76,3 @@ /*!

return queue.push([ 'convolve', (sharp) => {
return queue.push(['convolve', (sharp) => {
return sharp.convolve({

@@ -79,0 +79,0 @@ width: args.width,

@@ -54,3 +54,3 @@ /*!

const handler = (args) => {
return queue.push([ 'flatten', (sharp) => {
return queue.push(['flatten', (sharp) => {
return sharp.flatten({ background: args.background })

@@ -57,0 +57,0 @@ }])

@@ -40,3 +40,3 @@ /*!

// Command handler.
const handler = (args) => queue.push([ 'flip', (sharp) => sharp.flip() ])
const handler = (args) => queue.push(['flip', (sharp) => sharp.flip()])

@@ -43,0 +43,0 @@ // Exports.

@@ -40,3 +40,3 @@ /*!

// Command handler.
const handler = (args) => queue.push([ 'flop', (sharp) => sharp.flop() ])
const handler = (args) => queue.push(['flop', (sharp) => sharp.flop()])

@@ -43,0 +43,0 @@ // Exports.

@@ -60,3 +60,3 @@ /*!

// Command handler.
const handler = (args) => queue.push([ 'gamma', (sharp) => {
const handler = (args) => queue.push(['gamma', (sharp) => {
return sharp.gamma(args.factor, args.factorOut || args.factor)

@@ -63,0 +63,0 @@ }])

@@ -60,3 +60,3 @@ /*!

// Command handler.
const handler = (args) => queue.push([ 'linear', (sharp) => sharp.linear(args.multiplier, args.offset) ])
const handler = (args) => queue.push(['linear', (sharp) => sharp.linear(args.multiplier, args.offset)])

@@ -63,0 +63,0 @@ // Exports.

@@ -55,3 +55,3 @@ /*!

const handler = (args) => {
return queue.push([ 'median', (sharp) => sharp.median(args.size) ])
return queue.push(['median', (sharp) => sharp.median(args.size)])
}

@@ -58,0 +58,0 @@

@@ -68,3 +68,3 @@ /*!

if (undefined !== args.hue) options.hue = args.hue
return queue.push([ 'modulate', (sharp) => {
return queue.push(['modulate', (sharp) => {
return sharp.modulate(options)

@@ -71,0 +71,0 @@ }])

@@ -40,3 +40,3 @@ /*!

// Command handler.
const handler = (args) => queue.push([ 'negate', (sharp) => sharp.negate() ])
const handler = (args) => queue.push(['negate', (sharp) => sharp.negate()])

@@ -43,0 +43,0 @@ // Exports.

@@ -40,3 +40,3 @@ /*!

// Command handler.
const handler = (args) => queue.push([ 'normalise', (sharp) => sharp.normalise() ])
const handler = (args) => queue.push(['normalise', (sharp) => sharp.normalise()])

@@ -43,0 +43,0 @@ // Exports.

@@ -56,3 +56,3 @@ /*!

return queue.push([ 'recomb', (sharp) => {
return queue.push(['recomb', (sharp) => {
return sharp.recomb([

@@ -59,0 +59,0 @@ matrix.slice(0, 3),

@@ -60,3 +60,3 @@ /*!

if (args.angle === 'auto') args.angle = undefined // Cast.
return queue.push([ 'rotate', (sharp) => {
return queue.push(['rotate', (sharp) => {
return sharp.rotate(args.angle, {

@@ -63,0 +63,0 @@ background: args.background

@@ -66,3 +66,3 @@ /*!

const handler = (args) => {
return queue.push([ 'sharpen', (sharp) => sharp.sharpen(args.sigma, args.flat, args.jagged) ])
return queue.push(['sharpen', (sharp) => sharp.sharpen(args.sigma, args.flat, args.jagged)])
}

@@ -69,0 +69,0 @@

@@ -59,3 +59,3 @@ /*!

const handler = (args) => {
return queue.push([ 'threshold', (sharp) => {
return queue.push(['threshold', (sharp) => {
return sharp.threshold(args.value, { greyscale: args.greyscale })

@@ -62,0 +62,0 @@ }])

@@ -36,3 +36,3 @@ /*!

angle: {
choices: [ 0, 90, 180, 270 ],
choices: [0, 90, 180, 270],
default: 0,

@@ -88,3 +88,3 @@ desc: 'Tile angle of rotation',

const handler = (args) => {
return queue.push([ 'tile', (sharp) => {
return queue.push(['tile', (sharp) => {
return sharp.tile({

@@ -91,0 +91,0 @@ size: args.size,

@@ -65,3 +65,3 @@ /*!

position: {
choices: [ ...constants.GRAVITY, ...constants.POSITION, ...constants.STRATEGY ],
choices: [...constants.GRAVITY, ...constants.POSITION, ...constants.STRATEGY],
default: 'centre',

@@ -103,3 +103,3 @@ desc: 'Position, gravity, or strategy to use when fit is cover or contain',

// @see https://sharp.pixelplumbing.com/en/stable/api-resize/#resize
return queue.push([ 'resize', (sharp) => {
return queue.push(['resize', (sharp) => {
return sharp.resize({

@@ -106,0 +106,0 @@ background: args.background,

@@ -71,3 +71,3 @@ /*!

const handler = (args) => {
return queue.push([ 'extend', (sharp) => {
return queue.push(['extend', (sharp) => {
return sharp.extend({

@@ -74,0 +74,0 @@ background: args.background,

@@ -65,3 +65,3 @@ /*!

const handler = (args) => {
return queue.push([ 'extract', (sharp) => {
return queue.push(['extract', (sharp) => {
return sharp.extract({

@@ -68,0 +68,0 @@ left: args.left,

@@ -65,3 +65,3 @@ /*!

position: {
choices: [ ...constants.GRAVITY, ...constants.POSITION, ...constants.STRATEGY ],
choices: [...constants.GRAVITY, ...constants.POSITION, ...constants.STRATEGY],
default: 'centre',

@@ -103,3 +103,3 @@ desc: 'Position, gravity, or strategy to use when fit is cover or contain',

// @see https://sharp.pixelplumbing.com/en/stable/api-resize/#resize
return queue.push([ 'resize', (sharp) => {
return queue.push(['resize', (sharp) => {
return sharp.resize({

@@ -106,0 +106,0 @@ background: args.background,

@@ -54,3 +54,3 @@ /*!

const handler = (args) => {
return queue.push([ 'trim', (sharp) => sharp.trim(args.threshold) ])
return queue.push(['trim', (sharp) => sharp.trim(args.threshold)])
}

@@ -57,0 +57,0 @@

@@ -57,3 +57,3 @@ /*!

alias: 'f',
choices: [ 'input', ...constants.FORMAT ],
choices: ['input', ...constants.FORMAT],
default: 'input',

@@ -185,2 +185,12 @@ desc: 'Force output to a given format',

// @see https://sharp.pixelplumbing.com/en/stable/api-output/#heif
hcompression: {
choices: constants.HEIF_COMPRESSION,
default: 'hevc',
desc: 'Compression format',
group: optimize,
nargs: 1,
type: 'string'
},
// @see https://sharp.pixelplumbing.com/en/stable/api-output/#webp

@@ -267,2 +277,11 @@ lossless: {

// @see https://sharp.pixelplumbing.com/en/stable/api-output/#webp
reductionEffort: {
defaultDescription: 4,
desc: 'Level of CPU effort to reduce file size',
group: optimize,
nargs: 1,
type: 'number'
},
// @see https://sharp.pixelplumbing.com/en/stable/api-input/#sequentialread

@@ -275,2 +294,9 @@ sequentialRead: {

// @see https://sharp.pixelplumbing.com/en/stable/api-output/#webp
smartSubsample: {
desc: 'High quality chroma subsampling',
group: optimize,
type: 'boolean'
},
// @see https://sharp.pixelplumbing.com/en/stable/api-output/#tiff

@@ -327,3 +353,3 @@ squash: {

.example('$0 -i ./input.jpg -o ./out resize 300 200', 'out/input.jpg will be a 300 pixels wide and 200 pixels high image containing a scaled and cropped version of input.jpg')
.example('$0 -i ./input.jpg -o ./out -mq90 rotate 180 -- resize 300 -- flatten "#ff6600" -- overlayWith ./overlay.png --gravity southeast -- sharpen', 'out/input.jpg will be an upside down, 300px wide, alpha channel flattened onto orange background, composited with overlay.png with SE gravity, sharpened, with metadata, 90% quality version of input.jpg')
.example('$0 -i ./input.jpg -o ./out -mq90 rotate 180 -- resize 300 -- flatten "#ff6600" -- composite ./overlay.png --gravity southeast -- sharpen', 'out/input.jpg will be an upside down, 300px wide, alpha channel flattened onto orange background, composited with overlay.png with SE gravity, sharpened, with metadata, 90% quality version of input.jpg')
.epilog('For more information on available options, please visit https://sharp.pixelplumbing.com/')

@@ -335,3 +361,3 @@ .showHelpOnFail(false)

.version(pkg.version).alias('version', 'v')
.group([ 'help', 'version' ], 'Misc. Options')
.group(['help', 'version'], 'Misc. Options')

@@ -360,3 +386,2 @@ // Commands.

.command(require('../cmd/operations/normalise'))
.command(require('../cmd/compositing/overlay-with'))
.command(require('../cmd/operations/recomb'))

@@ -397,5 +422,17 @@ .command(require('../cmd/channel-manipulation/remove-alpha'))

if (args.format !== options.format.default) {
queue.unshift([ 'format', (sharp) => sharp.toFormat(args.format) ])
queue.unshift(['format', (sharp) => sharp.toFormat(args.format)])
}
// @see https://sharp.pixelplumbing.com/en/stable/api-output/#heif
if (args.hcompression !== options.hcompression.default || args.lossless ||
args.quality) {
queue.unshift(['heif', (sharp) => {
return sharp.heif({
compression: args.hcompression,
lossless: args.lossless,
quality: args.quality
})
}])
}
// @see https://sharp.pixelplumbing.com/en/stable/api-output/#jpeg

@@ -413,3 +450,3 @@ if (

) {
queue.unshift([ 'jpeg', (sharp) => {
queue.unshift(['jpeg', (sharp) => {
return sharp.jpeg({

@@ -431,3 +468,3 @@ chromaSubsampling: args.chromaSubsampling,

if (undefined !== args.limitInputPixels) {
queue.unshift([ 'limitInputPixels', (sharp) => sharp.limitInputPixels(args.limitInputPixels) ])
queue.unshift(['limitInputPixels', (sharp) => sharp.limitInputPixels(args.limitInputPixels)])
}

@@ -438,3 +475,3 @@

args.dither || args.palette || args.progressive) {
queue.unshift([ 'png', (sharp) => {
queue.unshift(['png', (sharp) => {
return sharp.png({

@@ -454,3 +491,3 @@ adaptiveFiltering: args.adaptiveFiltering,

if (args.sequentialRead) {
queue.unshift([ 'sequentialRead', (sharp) => sharp.sequentialRead() ])
queue.unshift(['sequentialRead', (sharp) => sharp.sequentialRead()])
}

@@ -463,3 +500,3 @@

args.tileWidth || args.xres || args.yres) {
queue.unshift([ 'tiff', (sharp) => {
queue.unshift(['tiff', (sharp) => {
return sharp.tiff({

@@ -482,4 +519,5 @@ compression: args.compression,

// @see https://sharp.pixelplumbing.com/en/stable/api-output/#webp
if (args.alphaQuality || args.quality || args.lossless || args.nearLossless) {
queue.unshift([ 'webp', (sharp) => {
if (args.alphaQuality || args.quality || args.lossless ||
args.nearLossless || args.reductionEffort || args.smartSubsample) {
queue.unshift(['webp', (sharp) => {
return sharp.webp({

@@ -490,3 +528,5 @@ alphaQuality: args.alphaQuality,

nearLossless: args.nearLossless,
quality: args.quality
quality: args.quality,
reductionEffort: args.reductionEffort,
smartSubsample: args.smartSubsample
})

@@ -498,3 +538,3 @@ }])

if (args.withMetadata) {
queue.unshift([ 'withMetadata', (sharp) => sharp.withMetadata() ])
queue.unshift(['withMetadata', (sharp) => sharp.withMetadata()])
}

@@ -501,0 +541,0 @@ }

@@ -32,17 +32,18 @@ /*!

module.exports = {
BAND: [ 'red', 'green', 'blue' ],
BAND: ['red', 'green', 'blue'],
BLEND: Object.keys(sharp.blend),
BOOL: Object.keys(sharp.bool),
COLOURSPACE: Object.keys(sharp.colourspace),
CONTAINER: [ 'fs', 'zip' ],
DEPTH: [ 'onepixel', 'onetile', 'one' ],
CONTAINER: ['fs', 'zip'],
DEPTH: ['onepixel', 'onetile', 'one'],
FIT: Object.keys(sharp.fit),
FORMAT: [ 'jpeg', 'jpg', 'png', 'raw', 'tiff', 'webp' ],
FORMAT: ['heic', 'heif', 'jpeg', 'jpg', 'png', 'raw', 'tiff', 'webp'],
GRAVITY: Object.keys(sharp.gravity),
HEIF_COMPRESSION: ['hevc', 'avc', 'jpeg', 'av1'],
KERNEL: Object.keys(sharp.kernel),
LAYOUT: [ 'dz', 'google', 'zoomify' ],
LAYOUT: ['dz', 'google', 'zoomify'],
POSITION: Object.keys(sharp.position),
STRATEGY: Object.keys(sharp.strategy),
TIFF_COMPRESSION: [ 'ccittfax4', 'deflate', 'jpeg', 'lzw', 'none' ],
TIFF_PREDICTOR: [ 'float', 'horizontal', 'none' ]
TIFF_COMPRESSION: ['ccittfax4', 'deflate', 'jpeg', 'lzw', 'none'],
TIFF_PREDICTOR: ['float', 'horizontal', 'none']
}

@@ -32,2 +32,3 @@ /*!

const bubbleError = require('bubble-stream-error')
const isDirectory = require('is-directory')
const sharp = require('sharp')

@@ -53,7 +54,13 @@ const urlTemplate = require('url-template')

const template = urlTemplate.parse(output) // Parse output template.
output = path.resolve(output)
// Process files.
const isBatch = input.length > 1
const promises = input.map((src) => {
src = path.resolve(src) // Absolute path.
// Process file.
const transformer = queue.drain(sharp(src))
// Destination.
src = path.resolve(src) // Absolute path.
let dest = template.expand(path.parse(src))

@@ -66,15 +73,12 @@

}
dest = path.resolve(dest) // Absolute path.
// Absolute path.
dest = path.resolve(dest)
// Process file.
const transformer = queue.drain(sharp(src))
// If output was not a template, re-use source name.
if (output === dest) {
// If output was not a template, assume dest is a directory when using
// batch processing.
const outputAssumeDir = dest === output && isBatch
if (outputAssumeDir || isDirectory.sync(dest)) {
const defaultExt = path.extname(src)
const desiredExt = transformer.options.formatOut
dest = path.format({
dir: output,
dir: dest,
name: path.basename(src, defaultExt),

@@ -81,0 +85,0 @@ ext: desiredExt in EXTENSIONS ? EXTENSIONS[desiredExt] : defaultExt

@@ -40,3 +40,3 @@ /*!

return multiyargs(cli, argv)
.then(([ args ]) => {
.then(([args]) => {
if (args.input) {

@@ -43,0 +43,0 @@ return convert.files(args.input, args.output)

@@ -28,3 +28,3 @@ /*!

// Configure.
const queue = [ ]
const queue = []

@@ -35,3 +35,3 @@ // Extend object.

drain: {
value: (initialValue) => queue.reduce((acc, [ , cb ]) => cb(acc), initialValue)
value: (initialValue) => queue.reduce((acc, [, cb]) => cb(acc), initialValue)
},

@@ -41,3 +41,3 @@

pipeline: {
get: () => queue.map(([ value ]) => value)
get: () => queue.map(([value]) => value)
}

@@ -44,0 +44,0 @@ })

{
"name": "sharp-cli",
"version": "1.10.0",
"version": "1.11.0",
"description": "CLI for sharp.",

@@ -30,4 +30,5 @@ "keywords": [

"bubble-stream-error": "1.0.x",
"is-directory": "0.3.x",
"multiyargs": "1.0.x",
"sharp": "0.22.1",
"sharp": "0.23.1",
"url-template": "2.0.x",

@@ -37,9 +38,9 @@ "yargs": "12.0.x"

"devDependencies": {
"fs-extra": "8.0.x",
"mocha": "6.1.x",
"fs-extra": "8.1.x",
"mocha": "6.2.x",
"must": "0.13.x",
"nyc": "14.1.x",
"sinon": "7.3.x",
"sinon": "7.5.x",
"snazzy": "8.0.x",
"standard": "12.0.x",
"standard": "14.3.x",
"tempfile": "3.0.x"

@@ -46,0 +47,0 @@ },

@@ -44,4 +44,2 @@ # sharp-cli

[aliases: normalize]
sharp overlayWith <overlay> [DEPRECATED] Overlay (composite) an image over the
processed (resized, extracted etc.) image
sharp recomb <matrix> Recomb the image with the specified matrix

@@ -66,3 +64,3 @@ sharp removeAlpha Remove alpha channel, if any

--format, -f Force output to a given format
[choices: "input", "jpeg", "jpg", "png", "raw", "tiff", "webp"] [default: "input"]
[choices: "input", "heic", "heif", "jpeg", "jpg", "png", "raw", "tiff", "webp"] [default: "input"]
--input, -i Path to (an) image file(s) [array] [required] [default: stdin]

@@ -88,2 +86,4 @@ --limitInputPixels, -l Do not process input images where the number of pixels (width x height)

[number] [default: 1.0]
--hcompression Compression format
[string] [choices: "hevc", "avc", "jpeg", "av1"] [default: "hevc"]
--lossless Use lossless compression mode [boolean]

@@ -102,4 +102,7 @@ --nearLossless use near_lossless compression mode [boolean]

--quantisationTable, --quantizationTable Quantization table to use [number] [default: 0]
--reductionEffort Level of CPU effort to reduce file size
[number] [default: 4]
--sequentialRead An advanced setting that switches the libvips access
method to VIPS_ACCESS_SEQUENTIAL [boolean]
--smartSubsample High quality chroma subsampling [boolean]
--squash Squash 8-bit images down to 1 bit [boolean]

@@ -121,3 +124,3 @@ --tileHeight Vertical tile size [number]

sharp -i ./input.jpg -o ./out -mq90 rotate 180 -- out/input.jpg will be an upside down, 300px
resize 300 -- flatten "#ff6600" -- overlayWith wide, alpha channel flattened onto orange
resize 300 -- flatten "#ff6600" -- composite wide, alpha channel flattened onto orange
./overlay.png --gravity southeast -- sharpen background, composited with overlay.png with

@@ -124,0 +127,0 @@ SE gravity, sharpened, with metadata, 90%

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc