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
0
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 4.2.0 to 5.0.0

6

CHANGELOG.md
# Changelog
## 5.0.0 (July 14, 2024)
* Added `hbitdepth`, `miniswhite` options to `heif` command.
* Added `lineArt` option to `trim` command.
* Updated `sharp` dependency (requiring dependency to bump Node to 18.17+).
* Updated dependencies.
## 4.2.0 (November 25, 2023)

@@ -4,0 +10,0 @@ * Exit process when there are no input files ([#83](https://github.com/vseventer/sharp-cli/issues/83)).

2

cmd/resizing/resize.js

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

defaultDescription: 'lanczos3',
desc: 'The kernel to use for image reduction'
desc: 'The kernel to use for image reduction and the inferred interpolator to use for upsampling'
},

@@ -72,0 +72,0 @@ position: {

@@ -46,2 +46,7 @@ /*!

type: 'string'
},
lineArt: {
default: false,
desc: 'Does the input more closely resemble line art rather than being photographic',
type: 'boolean'
}

@@ -68,3 +73,3 @@ }

return queue.push(['trim', (sharp) => {
return sharp.trim({ background: args.background, threshold: args.threshold })
return sharp.trim({ background: args.background, lineArt: args.lineArt, threshold: args.threshold })
}])

@@ -71,0 +76,0 @@ }

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

defaultDescription: 8,
desc: 'Squash 8-bit images down to 1, 2, or 4 bit',
desc: 'Reduce bitdepth to 1, 2, or 4 bit',
group: optimize

@@ -296,2 +296,10 @@ },

// @see https://sharp.pixelplumbing.com/api-output#heif
hbitdepth: {
choices: [8, 10, 12],
defaultDescription: 8,
desc: 'Set bitdepth to 8, 10, or 12 bit',
group: optimize
},
// @see https://sharp.pixelplumbing.com/api-output#heif
hcompression: {

@@ -334,2 +342,9 @@ choices: constants.HEIF_COMPRESSION,

// @see https://sharp.pixelplumbing.com/api-output#tiff
miniswhite: {
desc: 'Write 1-bit images as miniswhite',
group: optimize,
type: 'boolean'
},
// @see https://sharp.pixelplumbing.com/api-output#webp

@@ -609,3 +624,3 @@ minSize: {

if (argv.format) {
queue.unshift(['format', (sharp) => sharp.toFormat(argv.format)])
queue.unshift(['format', (sharp) => sharp.toFormat(argv.format, { compression: argv.hcompression })])
}

@@ -622,5 +637,7 @@

// Ensure libheif is installed before applying generic options.
(heif.input && heif.input.file && (argv.effort || argv.lossless || argv.quality))) {
(heif.input && heif.input.file &&
(argv.effort || argv.hbitdepth || argv.lossless || argv.quality))) {
queue.unshift(['heif', (sharp) => {
return sharp.heif({
bitdepth: argv.hbitdepth,
compression: argv.hcompression,

@@ -717,4 +734,4 @@ effort: argv.effort,

argv.predictor !== optimizationOptions.predictor.default ||
argv.pyramid || argv.quality || argv.resolutionUnit || argv.tileBackground ||
argv.tileHeight || argv.tileWidth || argv.xres || argv.yres) {
argv.miniswhite || argv.pyramid || argv.quality || argv.resolutionUnit ||
argv.tileBackground || argv.tileHeight || argv.tileWidth || argv.xres || argv.yres) {
queue.unshift(['tiff', (sharp) => {

@@ -726,2 +743,3 @@ return sharp.tiff({

force: false,
miniswhite: argv.miniswhite,
predictor: argv.predictor,

@@ -728,0 +746,0 @@ pyramid: argv.pyramid,

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

const bubbleError = require('bubble-stream-error')
const glob = require('glob')
const { globSync } = require('glob')
const isDirectory = require('is-directory')

@@ -59,3 +59,3 @@ const sharp = require('sharp')

const files = input.reduce((list, input) => {
return list.concat(glob.sync(input, { absolute: true }))
return list.concat(globSync(input, { absolute: true }))
}, [])

@@ -62,0 +62,0 @@

{
"name": "sharp-cli",
"version": "4.2.0",
"version": "5.0.0",
"description": "CLI for sharp.",

@@ -30,21 +30,21 @@ "keywords": [

"bubble-stream-error": "1.0.x",
"glob": "8.0.x",
"glob": "11.0.x",
"is-directory": "0.3.x",
"lodash.pick": "^4.4.0",
"sharp": "0.32.6",
"lodash.pick": "3.1.x",
"sharp": "0.33.4",
"yargs": "^17.6.2"
},
"devDependencies": {
"fs-extra": "11.1.x",
"mocha": "10.1.x",
"fs-extra": "11.2.x",
"mocha": "10.6.x",
"must": "0.13.x",
"nyc": "15.1.x",
"sinon": "15.0.x",
"nyc": "17.0.x",
"sinon": "18.0.x",
"snazzy": "9.0.x",
"standard": "17.0.x",
"standard": "17.1.x",
"tempy": "1.0.x"
},
"engines": {
"node": ">=14.15"
"node": ">=18.17"
}
}

@@ -109,3 +109,3 @@ # sharp-cli

--alphaQuality Quality of alpha layer [number] [default: 80]
--bitdepth Squash 8-bit images down to 1, 2, or 4 bit
--bitdepth Reduce bitdepth to 1, 2, or 4 bit
[choices: 1, 2, 4, 8] [default: 8]

@@ -125,2 +125,4 @@ --chromaSubsampling Set to "4:4:4" to prevent chroma subsampling when

[number] [default: 7 (GIF, PNG) / 4]
--hbitdepth Set bitdepth to 8, 10, or 12 bit
[choices: 8, 10, 12] [default: 8]
--hcompression Compression format

@@ -133,2 +135,3 @@ [choices: "hevc", "av1"] [default: "av1"]

--lossless Use lossless compression mode [boolean]
--miniswhite Write 1-bit images as miniswhite [boolean]
--minSize Prevent use of animation key frames to minimize file

@@ -135,0 +138,0 @@ size [boolean]

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