Skip to content

Commit 724ebbd

Browse files
committed
Update sharp to add Apple M1 support - fixes #61.
1 parent a3d78cc commit 724ebbd

File tree

9 files changed

+6385
-362
lines changed

9 files changed

+6385
-362
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 2.0.0
4+
* Removed `--limitInputPixels` and `--sequentialRead`.
5+
* Added [`--limitInputPixels`](https://sharp.pixelplumbing.com/api-composite#composite) when compositing images.
6+
* Updated `sharp` dependency (adding support for Apple M1) ([#61](https://github.com/vseventer/sharp-cli/pull/61)).
7+
38
## 1.15.0 (March 13, 2021)
49
* Added [`alpha`](https://sharp.pixelplumbing.com/api-channel#extractchannel) band option to `extractChannel`.
510
* Added [`density`, `level`, `page`, and `pages`](https://sharp.pixelplumbing.com/api-constructor) to input options.

README.md

-4
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ Global Options
6464
[choices: "input", "heif", "jpeg", "jpg", "png", "raw", "tiff", "webp"] [default: "input"]
6565
--input, -i Path to (an) image file(s) [array] [required] [default: stdin]
6666
--level Level to extract from a multi-level input [number]
67-
--limitInputPixels, -l Do not process input images where the number of pixels (width x height)
68-
exceeds this limit [number] [default: 268402689]
6967
--output, -o Directory or URI template to write the image files to
7068
[string] [required] [default: stdout]
7169
--page Page number to start extracting from for multi-page input [number]
@@ -102,8 +100,6 @@ Optimization Options
102100
--quantisationTable, --quantizationTable Quantization table to use [number] [default: 0]
103101
--reductionEffort Level of CPU effort to reduce file size
104102
[number] [default: 4]
105-
--sequentialRead An advanced setting that switches the libvips access
106-
method to VIPS_ACCESS_SEQUENTIAL [boolean]
107103
--smartSubsample High quality chroma subsampling [boolean]
108104
--squash Squash 8-bit images down to 1 bit [boolean]
109105
--tileBackground Background colour, parsed by the color module

cmd/compositing/composite.js

+7
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ const options = {
6767
normalize: true,
6868
type: 'string'
6969
},
70+
limitInputPixels: {
71+
defaultDescription: 0x3FFF * 0x3FFF,
72+
desc: 'Do not process input images where the number of pixels (width x height) exceeds this limit',
73+
nargs: 1,
74+
type: 'number'
75+
},
7076
offset: {
7177
desc: 'The pixel offset from the top and left edges',
7278
nargs: 2,
@@ -108,6 +114,7 @@ const handler = (args) => {
108114
density: args.density,
109115
gravity: args.gravity,
110116
left,
117+
limitInputPixels: args.limitInputPixels,
111118
premultiplied: args.premultiplied,
112119
tile: args.tile,
113120
top

lib/cli.js

+1-18
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,6 @@ const options = {
9191
type: 'number'
9292
},
9393

94-
// @see https://sharp.pixelplumbing.com/en/stable/api-input/#limitinputpixels
95-
limitInputPixels: {
96-
alias: 'l',
97-
defaultDescription: 0x3FFF * 0x3FFF,
98-
desc: 'Do not process input images where the number of pixels (width x height) exceeds this limit',
99-
group: _global,
100-
nargs: 1,
101-
type: 'number'
102-
},
103-
10494
// @see https://sharp.pixelplumbing.com/en/stable/api-output/
10595
output: {
10696
alias: 'o',
@@ -219,7 +209,7 @@ const options = {
219209
// @see https://sharp.pixelplumbing.com/en/stable/api-output/#heif
220210
hcompression: {
221211
choices: constants.HEIF_COMPRESSION,
222-
default: 'hevc',
212+
default: 'av1',
223213
desc: 'Compression format',
224214
group: optimize,
225215
nargs: 1,
@@ -316,13 +306,6 @@ const options = {
316306
type: 'number'
317307
},
318308

319-
// @see https://sharp.pixelplumbing.com/en/stable/api-input/#sequentialread
320-
sequentialRead: {
321-
desc: 'An advanced setting that switches the libvips access method to VIPS_ACCESS_SEQUENTIAL',
322-
group: optimize,
323-
type: 'boolean'
324-
},
325-
326309
// @see https://sharp.pixelplumbing.com/en/stable/api-output/#webp
327310
smartSubsample: {
328311
desc: 'High quality chroma subsampling',

lib/constants.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports = {
3838
FIT: Object.keys(sharp.fit),
3939
FORMAT: ['heif', 'jpeg', 'jpg', 'png', 'raw', 'tiff', 'webp'],
4040
GRAVITY: Object.keys(sharp.gravity),
41-
HEIF_COMPRESSION: ['hevc', 'avc', 'jpeg', 'av1'],
41+
HEIF_COMPRESSION: ['hevc', 'av1'],
4242
KERNEL: Object.keys(sharp.kernel),
4343
LAYOUT: ['dz', 'google', 'iiif', 'zoomify'],
4444
POSITION: Object.keys(sharp.position),

0 commit comments

Comments
 (0)