@revizly/sharp 0.35.0-revizly47 → 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/resize.cjs +8 -8
- package/dist/resize.mjs +8 -8
- package/dist/sharp.cjs +2 -2
- package/dist/sharp.mjs +2 -2
- package/package.json +13 -13
- package/src/common.cc +4 -4
- package/src/common.h +2 -2
package/dist/resize.cjs
CHANGED
|
@@ -265,19 +265,19 @@ function resize (widthOrOptions, height, options) {
|
|
|
265
265
|
if (is.defined(widthOrOptions)) {
|
|
266
266
|
if (is.object(widthOrOptions) && !is.defined(options)) {
|
|
267
267
|
options = widthOrOptions;
|
|
268
|
-
} else if (is.integer(widthOrOptions) && widthOrOptions
|
|
268
|
+
} else if (is.integer(widthOrOptions) && is.inRange(widthOrOptions, 1, 100000000)) {
|
|
269
269
|
this.options.width = widthOrOptions;
|
|
270
270
|
} else {
|
|
271
|
-
throw is.invalidParameterError('width', 'positive integer', widthOrOptions);
|
|
271
|
+
throw is.invalidParameterError('width', 'positive integer between 1 and 100000000', widthOrOptions);
|
|
272
272
|
}
|
|
273
273
|
} else {
|
|
274
274
|
this.options.width = -1;
|
|
275
275
|
}
|
|
276
276
|
if (is.defined(height)) {
|
|
277
|
-
if (is.integer(height) && height
|
|
277
|
+
if (is.integer(height) && is.inRange(height, 1, 100000000)) {
|
|
278
278
|
this.options.height = height;
|
|
279
279
|
} else {
|
|
280
|
-
throw is.invalidParameterError('height', 'positive integer', height);
|
|
280
|
+
throw is.invalidParameterError('height', 'positive integer between 1 and 100000000', height);
|
|
281
281
|
}
|
|
282
282
|
} else {
|
|
283
283
|
this.options.height = -1;
|
|
@@ -285,18 +285,18 @@ function resize (widthOrOptions, height, options) {
|
|
|
285
285
|
if (is.object(options)) {
|
|
286
286
|
// Width
|
|
287
287
|
if (is.defined(options.width)) {
|
|
288
|
-
if (is.integer(options.width) && options.width
|
|
288
|
+
if (is.integer(options.width) && is.inRange(options.width, 1, 100000000)) {
|
|
289
289
|
this.options.width = options.width;
|
|
290
290
|
} else {
|
|
291
|
-
throw is.invalidParameterError('width', 'positive integer', options.width);
|
|
291
|
+
throw is.invalidParameterError('width', 'positive integer between 1 and 100000000', options.width);
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
// Height
|
|
295
295
|
if (is.defined(options.height)) {
|
|
296
|
-
if (is.integer(options.height) && options.height
|
|
296
|
+
if (is.integer(options.height) && is.inRange(options.height, 1, 100000000)) {
|
|
297
297
|
this.options.height = options.height;
|
|
298
298
|
} else {
|
|
299
|
-
throw is.invalidParameterError('height', 'positive integer', options.height);
|
|
299
|
+
throw is.invalidParameterError('height', 'positive integer between 1 and 100000000', options.height);
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
// Fit
|
package/dist/resize.mjs
CHANGED
|
@@ -265,19 +265,19 @@ function resize (widthOrOptions, height, options) {
|
|
|
265
265
|
if (is.defined(widthOrOptions)) {
|
|
266
266
|
if (is.object(widthOrOptions) && !is.defined(options)) {
|
|
267
267
|
options = widthOrOptions;
|
|
268
|
-
} else if (is.integer(widthOrOptions) && widthOrOptions
|
|
268
|
+
} else if (is.integer(widthOrOptions) && is.inRange(widthOrOptions, 1, 100000000)) {
|
|
269
269
|
this.options.width = widthOrOptions;
|
|
270
270
|
} else {
|
|
271
|
-
throw is.invalidParameterError('width', 'positive integer', widthOrOptions);
|
|
271
|
+
throw is.invalidParameterError('width', 'positive integer between 1 and 100000000', widthOrOptions);
|
|
272
272
|
}
|
|
273
273
|
} else {
|
|
274
274
|
this.options.width = -1;
|
|
275
275
|
}
|
|
276
276
|
if (is.defined(height)) {
|
|
277
|
-
if (is.integer(height) && height
|
|
277
|
+
if (is.integer(height) && is.inRange(height, 1, 100000000)) {
|
|
278
278
|
this.options.height = height;
|
|
279
279
|
} else {
|
|
280
|
-
throw is.invalidParameterError('height', 'positive integer', height);
|
|
280
|
+
throw is.invalidParameterError('height', 'positive integer between 1 and 100000000', height);
|
|
281
281
|
}
|
|
282
282
|
} else {
|
|
283
283
|
this.options.height = -1;
|
|
@@ -285,18 +285,18 @@ function resize (widthOrOptions, height, options) {
|
|
|
285
285
|
if (is.object(options)) {
|
|
286
286
|
// Width
|
|
287
287
|
if (is.defined(options.width)) {
|
|
288
|
-
if (is.integer(options.width) && options.width
|
|
288
|
+
if (is.integer(options.width) && is.inRange(options.width, 1, 100000000)) {
|
|
289
289
|
this.options.width = options.width;
|
|
290
290
|
} else {
|
|
291
|
-
throw is.invalidParameterError('width', 'positive integer', options.width);
|
|
291
|
+
throw is.invalidParameterError('width', 'positive integer between 1 and 100000000', options.width);
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
// Height
|
|
295
295
|
if (is.defined(options.height)) {
|
|
296
|
-
if (is.integer(options.height) && options.height
|
|
296
|
+
if (is.integer(options.height) && is.inRange(options.height, 1, 100000000)) {
|
|
297
297
|
this.options.height = options.height;
|
|
298
298
|
} else {
|
|
299
|
-
throw is.invalidParameterError('height', 'positive integer', options.height);
|
|
299
|
+
throw is.invalidParameterError('height', 'positive integer between 1 and 100000000', options.height);
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
// Fit
|
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
|
|
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
|
|
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-
|
|
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.
|
|
167
|
-
"@revizly/sharp-libvips-linux-x64": "1.0.
|
|
168
|
-
"@revizly/sharp-linux-arm64": "0.35.0-
|
|
169
|
-
"@revizly/sharp-linux-x64": "0.35.0-
|
|
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": {
|
|
@@ -174,18 +174,18 @@
|
|
|
174
174
|
}
|
|
175
175
|
},
|
|
176
176
|
"devDependencies": {
|
|
177
|
-
"@biomejs/biome": "^2.5.
|
|
177
|
+
"@biomejs/biome": "^2.5.10",
|
|
178
178
|
"@cpplint/cli": "^0.1.0",
|
|
179
|
-
"@emnapi/runtime": "^1.11.
|
|
180
|
-
"@revizly/sharp-libvips-dev": "1.0.
|
|
179
|
+
"@emnapi/runtime": "^1.11.3",
|
|
180
|
+
"@revizly/sharp-libvips-dev": "1.0.50",
|
|
181
181
|
"@types/node": "*",
|
|
182
|
-
"emnapi": "^1.11.
|
|
182
|
+
"emnapi": "^1.11.3",
|
|
183
183
|
"exif-reader": "^2.0.3",
|
|
184
|
-
"
|
|
184
|
+
"yauzl": "^3.4.0",
|
|
185
185
|
"icc": "^4.0.0",
|
|
186
|
-
"node-addon-api": "^8.9.
|
|
186
|
+
"node-addon-api": "^8.9.2",
|
|
187
187
|
"node-gyp": "^12.4.0",
|
|
188
|
-
"publint": "^0.3.
|
|
188
|
+
"publint": "^0.3.24",
|
|
189
189
|
"tar-fs": "^3.1.3",
|
|
190
190
|
"tsd": "^0.33.0"
|
|
191
191
|
},
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
"node": ">=20.9.0"
|
|
195
195
|
},
|
|
196
196
|
"config": {
|
|
197
|
-
"libvips": ">=8.18.
|
|
197
|
+
"libvips": ">=8.18.6"
|
|
198
198
|
},
|
|
199
199
|
"funding": {
|
|
200
200
|
"url": "https://opencollective.com/libvips"
|
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::
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
.
|
|
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);
|
package/src/common.h
CHANGED
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
|
|
20
20
|
#if (VIPS_MAJOR_VERSION < 8) || \
|
|
21
21
|
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION < 18) || \
|
|
22
|
-
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION == 18 && VIPS_MICRO_VERSION <
|
|
23
|
-
#error "libvips version 8.18.
|
|
22
|
+
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION == 18 && VIPS_MICRO_VERSION < 6)
|
|
23
|
+
#error "libvips version 8.18.6+ is required - please see https://sharp.pixelplumbing.com/install"
|
|
24
24
|
#endif
|
|
25
25
|
|
|
26
26
|
#if defined(__has_include)
|