@revizly/sharp 0.35.0-revizly48 → 0.35.0-revizly49

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/sharp.cjs CHANGED
@@ -65,8 +65,8 @@ if (!sharp) {
65
65
 
66
66
  const help = [`Could not load the "sharp" module using the ${runtimePlatform} runtime`];
67
67
  errors.forEach((err) => {
68
- if (!err.code.endsWith("MODULE_NOT_FOUND")) {
69
- help.push(`${err.code}: ${err.message}`);
68
+ if (!err.code?.endsWith("MODULE_NOT_FOUND")) {
69
+ help.push(err.code ? `${err.code}: ${err.message}` : err.message);
70
70
  }
71
71
  });
72
72
  const messages = errors.map((err) => err.message).join(" ");
package/dist/sharp.mjs CHANGED
@@ -65,8 +65,8 @@ if (!sharp) {
65
65
 
66
66
  const help = [`Could not load the "sharp" module using the ${runtimePlatform} runtime`];
67
67
  errors.forEach((err) => {
68
- if (!err.code.endsWith("MODULE_NOT_FOUND")) {
69
- help.push(`${err.code}: ${err.message}`);
68
+ if (!err.code?.endsWith("MODULE_NOT_FOUND")) {
69
+ help.push(err.code ? `${err.code}: ${err.message}` : err.message);
70
70
  }
71
71
  });
72
72
  const messages = errors.map((err) => err.message).join(" ");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@revizly/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.0-revizly48",
4
+ "version": "0.35.0-revizly49",
5
5
  "author": "Lovell Fuller <npm@lovell.info>",
6
6
  "homepage": "https://sharp.pixelplumbing.com",
7
7
  "contributors": [
@@ -163,10 +163,10 @@
163
163
  "semver": "^7.8.5"
164
164
  },
165
165
  "optionalDependencies": {
166
- "@revizly/sharp-libvips-linux-arm64": "1.0.49",
167
- "@revizly/sharp-libvips-linux-x64": "1.0.49",
168
- "@revizly/sharp-linux-arm64": "0.35.0-revizly48",
169
- "@revizly/sharp-linux-x64": "0.35.0-revizly48"
166
+ "@revizly/sharp-libvips-linux-arm64": "1.0.50",
167
+ "@revizly/sharp-libvips-linux-x64": "1.0.50",
168
+ "@revizly/sharp-linux-arm64": "0.35.0-revizly49",
169
+ "@revizly/sharp-linux-x64": "0.35.0-revizly49"
170
170
  },
171
171
  "peerDependenciesMeta": {
172
172
  "@types/node": {
@@ -177,7 +177,7 @@
177
177
  "@biomejs/biome": "^2.5.10",
178
178
  "@cpplint/cli": "^0.1.0",
179
179
  "@emnapi/runtime": "^1.11.3",
180
- "@revizly/sharp-libvips-dev": "1.0.49",
180
+ "@revizly/sharp-libvips-dev": "1.0.50",
181
181
  "@types/node": "*",
182
182
  "emnapi": "^1.11.3",
183
183
  "exif-reader": "^2.0.3",
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);