sharp 0.35.4-rc.0 → 0.35.5-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1404,7 +1404,7 @@ declare namespace sharp {
1404
1404
  chromaSubsampling?: '4:4:4' | '4:2:0';
1405
1405
  }
1406
1406
 
1407
- interface JxlOptions extends OutputOptions {
1407
+ interface JxlOptions extends OutputOptions, AnimationOptions {
1408
1408
  /** Maximum encoding error, between 0 (highest quality) and 15 (lowest quality) (optional, default 1.0) */
1409
1409
  distance?: number;
1410
1410
  /** Calculate distance based on JPEG-like quality, between 1 and 100, overrides distance if specified */
@@ -1413,7 +1413,7 @@ declare namespace sharp {
1413
1413
  decodingTier?: number;
1414
1414
  /** Use lossless compression (optional, default false) */
1415
1415
  lossless?: boolean;
1416
- /** CPU effort, between 3 (fastest) and 9 (slowest) (optional, default 7) */
1416
+ /** CPU effort, between 1 (fastest) and 9 (slowest) (optional, default 7) */
1417
1417
  effort?: number | undefined;
1418
1418
  }
1419
1419
 
package/dist/index.d.mts CHANGED
@@ -1398,7 +1398,7 @@ export interface Jp2Options extends OutputOptions {
1398
1398
  chromaSubsampling?: '4:4:4' | '4:2:0';
1399
1399
  }
1400
1400
 
1401
- export interface JxlOptions extends OutputOptions {
1401
+ export interface JxlOptions extends OutputOptions, AnimationOptions {
1402
1402
  /** Maximum encoding error, between 0 (highest quality) and 15 (lowest quality) (optional, default 1.0) */
1403
1403
  distance?: number;
1404
1404
  /** Calculate distance based on JPEG-like quality, between 1 and 100, overrides distance if specified */
@@ -1407,7 +1407,7 @@ export interface JxlOptions extends OutputOptions {
1407
1407
  decodingTier?: number;
1408
1408
  /** Use lossless compression (optional, default false) */
1409
1409
  lossless?: boolean;
1410
- /** CPU effort, between 3 (fastest) and 9 (slowest) (optional, default 7) */
1410
+ /** CPU effort, between 1 (fastest) and 9 (slowest) (optional, default 7) */
1411
1411
  effort?: number | undefined;
1412
1412
  }
1413
1413
 
@@ -2041,6 +2041,6 @@ export interface SharpConstructor {
2041
2041
  bool: BoolEnum;
2042
2042
  }
2043
2043
 
2044
- export const sharp: SharpConstructor;
2044
+ declare const sharp: SharpConstructor;
2045
2045
  export default sharp;
2046
2046
 
package/dist/is.cjs CHANGED
@@ -107,9 +107,15 @@ const inArray = (val, list) => list.includes(val);
107
107
  * @returns {Error} Containing the formatted message.
108
108
  * @private
109
109
  */
110
- const invalidParameterError = (name, expected, actual) => new Error(
111
- `Expected ${expected} for ${name} but received ${actual} of type ${typeof actual}`
110
+ const invalidParameterError = (name, expected, actual) => {
111
+ let actualString;
112
+ try {
113
+ actualString = String(actual).slice(0, 100);
114
+ } catch {}
115
+ return new Error(
116
+ `Expected ${expected} for ${name} but received ${actualString} of type ${typeof actual}`
112
117
  );
118
+ };
113
119
 
114
120
  /**
115
121
  * Ensures an Error from C++ contains a JS stack.
package/dist/is.mjs CHANGED
@@ -107,9 +107,15 @@ const inArray = (val, list) => list.includes(val);
107
107
  * @returns {Error} Containing the formatted message.
108
108
  * @private
109
109
  */
110
- const invalidParameterError = (name, expected, actual) => new Error(
111
- `Expected ${expected} for ${name} but received ${actual} of type ${typeof actual}`
110
+ const invalidParameterError = (name, expected, actual) => {
111
+ let actualString;
112
+ try {
113
+ actualString = String(actual).slice(0, 100);
114
+ } catch {}
115
+ return new Error(
116
+ `Expected ${expected} for ${name} but received ${actualString} of type ${typeof actual}`
112
117
  );
118
+ };
113
119
 
114
120
  /**
115
121
  * Ensures an Error from C++ contains a JS stack.
@@ -824,7 +824,7 @@ function linear (a, b) {
824
824
  this.options.linearA = [];
825
825
  } else if (is.number(a)) {
826
826
  this.options.linearA = [a];
827
- } else if (Array.isArray(a) && a.length && a.every(is.number)) {
827
+ } else if (Array.isArray(a) && is.inRange(a.length, 1, 1000000) && a.every(is.number)) {
828
828
  this.options.linearA = a;
829
829
  } else {
830
830
  throw is.invalidParameterError('a', 'number or array of numbers', a);
@@ -833,7 +833,7 @@ function linear (a, b) {
833
833
  this.options.linearB = [];
834
834
  } else if (is.number(b)) {
835
835
  this.options.linearB = [b];
836
- } else if (Array.isArray(b) && b.length && b.every(is.number)) {
836
+ } else if (Array.isArray(b) && is.inRange(b.length, 1, 1000000) && b.every(is.number)) {
837
837
  this.options.linearB = b;
838
838
  } else {
839
839
  throw is.invalidParameterError('b', 'number or array of numbers', b);
@@ -824,7 +824,7 @@ function linear (a, b) {
824
824
  this.options.linearA = [];
825
825
  } else if (is.number(a)) {
826
826
  this.options.linearA = [a];
827
- } else if (Array.isArray(a) && a.length && a.every(is.number)) {
827
+ } else if (Array.isArray(a) && is.inRange(a.length, 1, 1000000) && a.every(is.number)) {
828
828
  this.options.linearA = a;
829
829
  } else {
830
830
  throw is.invalidParameterError('a', 'number or array of numbers', a);
@@ -833,7 +833,7 @@ function linear (a, b) {
833
833
  this.options.linearB = [];
834
834
  } else if (is.number(b)) {
835
835
  this.options.linearB = [b];
836
- } else if (Array.isArray(b) && b.length && b.every(is.number)) {
836
+ } else if (Array.isArray(b) && is.inRange(b.length, 1, 1000000) && b.every(is.number)) {
837
837
  this.options.linearB = b;
838
838
  } else {
839
839
  throw is.invalidParameterError('b', 'number or array of numbers', b);
package/dist/output.cjs CHANGED
@@ -1066,6 +1066,7 @@ function trySetAnimationOptions (source, target) {
1066
1066
  target.delay = [source.delay];
1067
1067
  } else if (
1068
1068
  Array.isArray(source.delay) &&
1069
+ is.inRange(source.delay.length, 1, 1000000) &&
1069
1070
  source.delay.every(is.integer) &&
1070
1071
  source.delay.every(v => is.inRange(v, 0, 65535))) {
1071
1072
  target.delay = source.delay;
package/dist/output.mjs CHANGED
@@ -1066,6 +1066,7 @@ function trySetAnimationOptions (source, target) {
1066
1066
  target.delay = [source.delay];
1067
1067
  } else if (
1068
1068
  Array.isArray(source.delay) &&
1069
+ is.inRange(source.delay.length, 1, 1000000) &&
1069
1070
  source.delay.every(is.integer) &&
1070
1071
  source.delay.every(v => is.inRange(v, 0, 65535))) {
1071
1072
  target.delay = source.delay;
package/dist/resize.cjs CHANGED
@@ -386,10 +386,10 @@ function resize (widthOrOptions, height, options) {
386
386
  * ...
387
387
  *
388
388
  * @param {(number|Object)} extend - single pixel count to add to all edges or an Object with per-edge counts
389
- * @param {number} [extend.top=0] - number of pixels to add to the top edge, valid values are integers in the range 0-10000
390
- * @param {number} [extend.left=0] - number of pixels to add to the left edge, valid values are integers in the range 0-10000
391
- * @param {number} [extend.bottom=0] - number of pixels to add to the bottom edge, valid values are integers in the range 0-10000
392
- * @param {number} [extend.right=0] - number of pixels to add to the right edge, valid values are integers in the range 0-10000
389
+ * @param {number} [extend.top=0] - number of pixels to add to the top edge, valid values are integers in the range 0-100000000
390
+ * @param {number} [extend.left=0] - number of pixels to add to the left edge, valid values are integers in the range 0-100000000
391
+ * @param {number} [extend.bottom=0] - number of pixels to add to the bottom edge, valid values are integers in the range 0-100000000
392
+ * @param {number} [extend.right=0] - number of pixels to add to the right edge, valid values are integers in the range 0-100000000
393
393
  * @param {String} [extend.extendWith='background'] - populate new pixels using this method, one of: background, copy, repeat, mirror.
394
394
  * @param {String|Object} [extend.background={r: 0, g: 0, b: 0, alpha: 1}] - background colour, parsed by the [color](https://www.npmjs.org/package/color) module, defaults to black without transparency.
395
395
  * @returns {Sharp}
@@ -397,41 +397,41 @@ function resize (widthOrOptions, height, options) {
397
397
  */
398
398
  function extend (extend) {
399
399
  if (is.integer(extend)) {
400
- if (is.inRange(extend, 1, 10000)) {
400
+ if (is.inRange(extend, 1, 100000000)) {
401
401
  this.options.extendTop = extend;
402
402
  this.options.extendBottom = extend;
403
403
  this.options.extendLeft = extend;
404
404
  this.options.extendRight = extend;
405
405
  } else {
406
- throw is.invalidParameterError('extend', 'integer between 1 and 10000', extend);
406
+ throw is.invalidParameterError('extend', 'integer between 1 and 100000000', extend);
407
407
  }
408
408
  } else if (is.object(extend)) {
409
409
  if (is.defined(extend.top)) {
410
- if (is.integer(extend.top) && is.inRange(extend.top, 0, 10000)) {
410
+ if (is.integer(extend.top) && is.inRange(extend.top, 0, 100000000)) {
411
411
  this.options.extendTop = extend.top;
412
412
  } else {
413
- throw is.invalidParameterError('top', 'integer between 0 and 10000', extend.top);
413
+ throw is.invalidParameterError('top', 'integer between 0 and 100000000', extend.top);
414
414
  }
415
415
  }
416
416
  if (is.defined(extend.bottom)) {
417
- if (is.integer(extend.bottom) && is.inRange(extend.bottom, 0, 10000)) {
417
+ if (is.integer(extend.bottom) && is.inRange(extend.bottom, 0, 100000000)) {
418
418
  this.options.extendBottom = extend.bottom;
419
419
  } else {
420
- throw is.invalidParameterError('bottom', 'integer between 0 and 10000', extend.bottom);
420
+ throw is.invalidParameterError('bottom', 'integer between 0 and 100000000', extend.bottom);
421
421
  }
422
422
  }
423
423
  if (is.defined(extend.left)) {
424
- if (is.integer(extend.left) && is.inRange(extend.left, 0, 10000)) {
424
+ if (is.integer(extend.left) && is.inRange(extend.left, 0, 100000000)) {
425
425
  this.options.extendLeft = extend.left;
426
426
  } else {
427
- throw is.invalidParameterError('left', 'integer between 0 and 10000', extend.left);
427
+ throw is.invalidParameterError('left', 'integer between 0 and 100000000', extend.left);
428
428
  }
429
429
  }
430
430
  if (is.defined(extend.right)) {
431
- if (is.integer(extend.right) && is.inRange(extend.right, 0, 10000)) {
431
+ if (is.integer(extend.right) && is.inRange(extend.right, 0, 100000000)) {
432
432
  this.options.extendRight = extend.right;
433
433
  } else {
434
- throw is.invalidParameterError('right', 'integer between 0 and 10000', extend.right);
434
+ throw is.invalidParameterError('right', 'integer between 0 and 100000000', extend.right);
435
435
  }
436
436
  }
437
437
  this._setBackgroundColourOption('extendBackground', extend.background);
package/dist/resize.mjs CHANGED
@@ -386,10 +386,10 @@ function resize (widthOrOptions, height, options) {
386
386
  * ...
387
387
  *
388
388
  * @param {(number|Object)} extend - single pixel count to add to all edges or an Object with per-edge counts
389
- * @param {number} [extend.top=0] - number of pixels to add to the top edge, valid values are integers in the range 0-10000
390
- * @param {number} [extend.left=0] - number of pixels to add to the left edge, valid values are integers in the range 0-10000
391
- * @param {number} [extend.bottom=0] - number of pixels to add to the bottom edge, valid values are integers in the range 0-10000
392
- * @param {number} [extend.right=0] - number of pixels to add to the right edge, valid values are integers in the range 0-10000
389
+ * @param {number} [extend.top=0] - number of pixels to add to the top edge, valid values are integers in the range 0-100000000
390
+ * @param {number} [extend.left=0] - number of pixels to add to the left edge, valid values are integers in the range 0-100000000
391
+ * @param {number} [extend.bottom=0] - number of pixels to add to the bottom edge, valid values are integers in the range 0-100000000
392
+ * @param {number} [extend.right=0] - number of pixels to add to the right edge, valid values are integers in the range 0-100000000
393
393
  * @param {String} [extend.extendWith='background'] - populate new pixels using this method, one of: background, copy, repeat, mirror.
394
394
  * @param {String|Object} [extend.background={r: 0, g: 0, b: 0, alpha: 1}] - background colour, parsed by the [color](https://www.npmjs.org/package/color) module, defaults to black without transparency.
395
395
  * @returns {Sharp}
@@ -397,41 +397,41 @@ function resize (widthOrOptions, height, options) {
397
397
  */
398
398
  function extend (extend) {
399
399
  if (is.integer(extend)) {
400
- if (is.inRange(extend, 1, 10000)) {
400
+ if (is.inRange(extend, 1, 100000000)) {
401
401
  this.options.extendTop = extend;
402
402
  this.options.extendBottom = extend;
403
403
  this.options.extendLeft = extend;
404
404
  this.options.extendRight = extend;
405
405
  } else {
406
- throw is.invalidParameterError('extend', 'integer between 1 and 10000', extend);
406
+ throw is.invalidParameterError('extend', 'integer between 1 and 100000000', extend);
407
407
  }
408
408
  } else if (is.object(extend)) {
409
409
  if (is.defined(extend.top)) {
410
- if (is.integer(extend.top) && is.inRange(extend.top, 0, 10000)) {
410
+ if (is.integer(extend.top) && is.inRange(extend.top, 0, 100000000)) {
411
411
  this.options.extendTop = extend.top;
412
412
  } else {
413
- throw is.invalidParameterError('top', 'integer between 0 and 10000', extend.top);
413
+ throw is.invalidParameterError('top', 'integer between 0 and 100000000', extend.top);
414
414
  }
415
415
  }
416
416
  if (is.defined(extend.bottom)) {
417
- if (is.integer(extend.bottom) && is.inRange(extend.bottom, 0, 10000)) {
417
+ if (is.integer(extend.bottom) && is.inRange(extend.bottom, 0, 100000000)) {
418
418
  this.options.extendBottom = extend.bottom;
419
419
  } else {
420
- throw is.invalidParameterError('bottom', 'integer between 0 and 10000', extend.bottom);
420
+ throw is.invalidParameterError('bottom', 'integer between 0 and 100000000', extend.bottom);
421
421
  }
422
422
  }
423
423
  if (is.defined(extend.left)) {
424
- if (is.integer(extend.left) && is.inRange(extend.left, 0, 10000)) {
424
+ if (is.integer(extend.left) && is.inRange(extend.left, 0, 100000000)) {
425
425
  this.options.extendLeft = extend.left;
426
426
  } else {
427
- throw is.invalidParameterError('left', 'integer between 0 and 10000', extend.left);
427
+ throw is.invalidParameterError('left', 'integer between 0 and 100000000', extend.left);
428
428
  }
429
429
  }
430
430
  if (is.defined(extend.right)) {
431
- if (is.integer(extend.right) && is.inRange(extend.right, 0, 10000)) {
431
+ if (is.integer(extend.right) && is.inRange(extend.right, 0, 100000000)) {
432
432
  this.options.extendRight = extend.right;
433
433
  } else {
434
- throw is.invalidParameterError('right', 'integer between 0 and 10000', extend.right);
434
+ throw is.invalidParameterError('right', 'integer between 0 and 100000000', extend.right);
435
435
  }
436
436
  }
437
437
  this._setBackgroundColourOption('extendBackground', extend.background);
package/dist/sharp.cjs CHANGED
@@ -112,8 +112,8 @@ if (!sharp) {
112
112
 
113
113
  const help = [`Could not load the "sharp" module using the ${runtimePlatform} runtime`];
114
114
  errors.forEach((err) => {
115
- if (!err.code.endsWith("MODULE_NOT_FOUND")) {
116
- help.push(`${err.code}: ${err.message}`);
115
+ if (!err.code?.endsWith("MODULE_NOT_FOUND")) {
116
+ help.push(err.code ? `${err.code}: ${err.message}` : err.message);
117
117
  }
118
118
  });
119
119
  const messages = errors.map((err) => err.message).join(" ");
@@ -122,7 +122,7 @@ if (!sharp) {
122
122
  if (isUnsupportedNodeRuntime()) {
123
123
  const { found, expected } = isUnsupportedNodeRuntime();
124
124
  help.push("- Please upgrade Node.js:", ` Found ${found}`, ` Requires ${expected}`);
125
- } else if (prebuiltPlatforms.includes(runtimePlatform)) {
125
+ } else if (prebuiltPlatforms.includes(runtimePlatform) && !/libstdc\+\+\.so/.test(messages)) {
126
126
  const [os, cpu] = runtimePlatform.split("-");
127
127
  const libc = os.endsWith("musl") ? " --libc=musl" : "";
128
128
  help.push(
package/dist/sharp.mjs CHANGED
@@ -112,8 +112,8 @@ if (!sharp) {
112
112
 
113
113
  const help = [`Could not load the "sharp" module using the ${runtimePlatform} runtime`];
114
114
  errors.forEach((err) => {
115
- if (!err.code.endsWith("MODULE_NOT_FOUND")) {
116
- help.push(`${err.code}: ${err.message}`);
115
+ if (!err.code?.endsWith("MODULE_NOT_FOUND")) {
116
+ help.push(err.code ? `${err.code}: ${err.message}` : err.message);
117
117
  }
118
118
  });
119
119
  const messages = errors.map((err) => err.message).join(" ");
@@ -122,7 +122,7 @@ if (!sharp) {
122
122
  if (isUnsupportedNodeRuntime()) {
123
123
  const { found, expected } = isUnsupportedNodeRuntime();
124
124
  help.push("- Please upgrade Node.js:", ` Found ${found}`, ` Requires ${expected}`);
125
- } else if (prebuiltPlatforms.includes(runtimePlatform)) {
125
+ } else if (prebuiltPlatforms.includes(runtimePlatform) && !/libstdc\+\+\.so/.test(messages)) {
126
126
  const [os, cpu] = runtimePlatform.split("-");
127
127
  const libc = os.endsWith("musl") ? " --libc=musl" : "";
128
128
  help.push(
package/lib/index.d.ts CHANGED
@@ -1404,7 +1404,7 @@ declare namespace sharp {
1404
1404
  chromaSubsampling?: '4:4:4' | '4:2:0';
1405
1405
  }
1406
1406
 
1407
- interface JxlOptions extends OutputOptions {
1407
+ interface JxlOptions extends OutputOptions, AnimationOptions {
1408
1408
  /** Maximum encoding error, between 0 (highest quality) and 15 (lowest quality) (optional, default 1.0) */
1409
1409
  distance?: number;
1410
1410
  /** Calculate distance based on JPEG-like quality, between 1 and 100, overrides distance if specified */
@@ -1413,7 +1413,7 @@ declare namespace sharp {
1413
1413
  decodingTier?: number;
1414
1414
  /** Use lossless compression (optional, default false) */
1415
1415
  lossless?: boolean;
1416
- /** CPU effort, between 3 (fastest) and 9 (slowest) (optional, default 7) */
1416
+ /** CPU effort, between 1 (fastest) and 9 (slowest) (optional, default 7) */
1417
1417
  effort?: number | undefined;
1418
1418
  }
1419
1419
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sharp",
3
3
  "description": "High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",
4
- "version": "0.35.4-rc.0",
4
+ "version": "0.35.5-rc.0",
5
5
  "author": "Lovell Fuller <npm@lovell.info>",
6
6
  "homepage": "https://sharp.pixelplumbing.com",
7
7
  "contributors": [
@@ -163,31 +163,31 @@
163
163
  "semver": "^7.8.5"
164
164
  },
165
165
  "optionalDependencies": {
166
- "@img/sharp-darwin-arm64": "0.35.4-rc.0",
167
- "@img/sharp-darwin-x64": "0.35.4-rc.0",
168
- "@img/sharp-freebsd-wasm32": "0.35.4-rc.0",
169
- "@img/sharp-libvips-darwin-arm64": "1.3.3-rc.0",
170
- "@img/sharp-libvips-darwin-x64": "1.3.3-rc.0",
171
- "@img/sharp-libvips-linux-arm": "1.3.3-rc.0",
172
- "@img/sharp-libvips-linux-arm64": "1.3.3-rc.0",
173
- "@img/sharp-libvips-linux-ppc64": "1.3.3-rc.0",
174
- "@img/sharp-libvips-linux-riscv64": "1.3.3-rc.0",
175
- "@img/sharp-libvips-linux-s390x": "1.3.3-rc.0",
176
- "@img/sharp-libvips-linux-x64": "1.3.3-rc.0",
177
- "@img/sharp-libvips-linuxmusl-arm64": "1.3.3-rc.0",
178
- "@img/sharp-libvips-linuxmusl-x64": "1.3.3-rc.0",
179
- "@img/sharp-linux-arm": "0.35.4-rc.0",
180
- "@img/sharp-linux-arm64": "0.35.4-rc.0",
181
- "@img/sharp-linux-ppc64": "0.35.4-rc.0",
182
- "@img/sharp-linux-riscv64": "0.35.4-rc.0",
183
- "@img/sharp-linux-s390x": "0.35.4-rc.0",
184
- "@img/sharp-linux-x64": "0.35.4-rc.0",
185
- "@img/sharp-linuxmusl-arm64": "0.35.4-rc.0",
186
- "@img/sharp-linuxmusl-x64": "0.35.4-rc.0",
187
- "@img/sharp-webcontainers-wasm32": "0.35.4-rc.0",
188
- "@img/sharp-win32-arm64": "0.35.4-rc.0",
189
- "@img/sharp-win32-ia32": "0.35.4-rc.0",
190
- "@img/sharp-win32-x64": "0.35.4-rc.0"
166
+ "@img/sharp-darwin-arm64": "0.35.5-rc.0",
167
+ "@img/sharp-darwin-x64": "0.35.5-rc.0",
168
+ "@img/sharp-freebsd-wasm32": "0.35.5-rc.0",
169
+ "@img/sharp-libvips-darwin-arm64": "1.3.4-rc.0",
170
+ "@img/sharp-libvips-darwin-x64": "1.3.4-rc.0",
171
+ "@img/sharp-libvips-linux-arm": "1.3.4-rc.0",
172
+ "@img/sharp-libvips-linux-arm64": "1.3.4-rc.0",
173
+ "@img/sharp-libvips-linux-ppc64": "1.3.4-rc.0",
174
+ "@img/sharp-libvips-linux-riscv64": "1.3.4-rc.0",
175
+ "@img/sharp-libvips-linux-s390x": "1.3.4-rc.0",
176
+ "@img/sharp-libvips-linux-x64": "1.3.4-rc.0",
177
+ "@img/sharp-libvips-linuxmusl-arm64": "1.3.4-rc.0",
178
+ "@img/sharp-libvips-linuxmusl-x64": "1.3.4-rc.0",
179
+ "@img/sharp-linux-arm": "0.35.5-rc.0",
180
+ "@img/sharp-linux-arm64": "0.35.5-rc.0",
181
+ "@img/sharp-linux-ppc64": "0.35.5-rc.0",
182
+ "@img/sharp-linux-riscv64": "0.35.5-rc.0",
183
+ "@img/sharp-linux-s390x": "0.35.5-rc.0",
184
+ "@img/sharp-linux-x64": "0.35.5-rc.0",
185
+ "@img/sharp-linuxmusl-arm64": "0.35.5-rc.0",
186
+ "@img/sharp-linuxmusl-x64": "0.35.5-rc.0",
187
+ "@img/sharp-webcontainers-wasm32": "0.35.5-rc.0",
188
+ "@img/sharp-win32-arm64": "0.35.5-rc.0",
189
+ "@img/sharp-win32-ia32": "0.35.5-rc.0",
190
+ "@img/sharp-win32-x64": "0.35.5-rc.0"
191
191
  },
192
192
  "peerDependenciesMeta": {
193
193
  "@types/node": {
@@ -195,24 +195,24 @@
195
195
  }
196
196
  },
197
197
  "devDependencies": {
198
- "@biomejs/biome": "^2.5.10",
198
+ "@biomejs/biome": "^2.5.14",
199
199
  "@cpplint/cli": "^0.1.0",
200
200
  "@emnapi/runtime": "^1.11.3",
201
- "@img/sharp-libvips-dev": "1.3.3-rc.0",
202
- "@img/sharp-libvips-dev-wasm32": "1.3.3-rc.0",
203
- "@img/sharp-libvips-win32-arm64": "1.3.3-rc.0",
204
- "@img/sharp-libvips-win32-ia32": "1.3.3-rc.0",
205
- "@img/sharp-libvips-win32-x64": "1.3.3-rc.0",
201
+ "@img/sharp-libvips-dev": "1.3.4-rc.0",
202
+ "@img/sharp-libvips-dev-wasm32": "1.3.4-rc.0",
203
+ "@img/sharp-libvips-win32-arm64": "1.3.4-rc.0",
204
+ "@img/sharp-libvips-win32-ia32": "1.3.4-rc.0",
205
+ "@img/sharp-libvips-win32-x64": "1.3.4-rc.0",
206
206
  "@types/node": "*",
207
207
  "emnapi": "^1.11.3",
208
208
  "exif-reader": "^2.0.3",
209
- "yauzl": "^3.4.0",
210
209
  "icc": "^4.0.0",
211
210
  "node-addon-api": "^8.9.2",
212
211
  "node-gyp": "^12.4.0",
213
212
  "publint": "^0.3.24",
214
213
  "tar-fs": "^3.1.3",
215
- "tsd": "^0.33.0"
214
+ "tsd": "^0.33.0",
215
+ "yauzl": "^3.4.0"
216
216
  },
217
217
  "license": "Apache-2.0",
218
218
  "engines": {
package/src/common.cc CHANGED
@@ -540,10 +540,10 @@ namespace sharp {
540
540
  if (channels == 4) {
541
541
  background.push_back(descriptor->createBackground[3]);
542
542
  }
543
- image = VImage::new_matrix(descriptor->createWidth, descriptor->createHeight)
544
- .copy(VImage::option()->set("interpretation",
545
- channels < 3 ? VIPS_INTERPRETATION_B_W : VIPS_INTERPRETATION_sRGB))
546
- .new_from_image(background);
543
+ image = VImage::black(descriptor->createWidth, descriptor->createHeight,
544
+ VImage::option()->set("bands", channels))
545
+ .copy(VImage::option()->set("interpretation", VIPS_INTERPRETATION_sRGB))
546
+ .linear(std::vector<double>(channels, 0.0), background, VImage::option()->set("uchar", true));
547
547
  }
548
548
  if (descriptor->createPageHeight > 0) {
549
549
  image.set(VIPS_META_PAGE_HEIGHT, descriptor->createPageHeight);