@revizly/sharp 0.35.0-revizly42 → 0.35.0-revizly43

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.
@@ -113,8 +113,8 @@ const blend = {
113
113
  * @param {Boolean} [images[].autoOrient=false] - set to true to use EXIF orientation data, if present, to orient the image.
114
114
  * @param {String} [images[].blend='over'] - how to blend this image with the image below.
115
115
  * @param {String} [images[].gravity='centre'] - gravity at which to place the overlay.
116
- * @param {Number} [images[].top] - the pixel offset from the top edge.
117
- * @param {Number} [images[].left] - the pixel offset from the left edge.
116
+ * @param {Number} [images[].top] - the pixel offset from the top edge, an integer between -100000000 and 100000000.
117
+ * @param {Number} [images[].left] - the pixel offset from the left edge, an integer between -100000000 and 100000000.
118
118
  * @param {Boolean} [images[].tile=false] - set to true to repeat the overlay image across the entire image with the given `gravity`.
119
119
  * @param {Boolean} [images[].premultiplied=false] - set to true to avoid premultiplying the image below. Equivalent to the `--premultiplied` vips option.
120
120
  * @param {Number} [images[].density=72] - number representing the DPI for vector overlay image.
@@ -163,17 +163,17 @@ function composite (images) {
163
163
  }
164
164
  }
165
165
  if (is.defined(image.left)) {
166
- if (is.integer(image.left)) {
166
+ if (is.integer(image.left) && is.inRange(image.left, -100000000, 100000000)) {
167
167
  composite.left = image.left;
168
168
  } else {
169
- throw is.invalidParameterError('left', 'integer', image.left);
169
+ throw is.invalidParameterError('left', 'integer between -100000000 and 100000000', image.left);
170
170
  }
171
171
  }
172
172
  if (is.defined(image.top)) {
173
- if (is.integer(image.top)) {
173
+ if (is.integer(image.top) && is.inRange(image.top, -100000000, 100000000)) {
174
174
  composite.top = image.top;
175
175
  } else {
176
- throw is.invalidParameterError('top', 'integer', image.top);
176
+ throw is.invalidParameterError('top', 'integer between -100000000 and 100000000', image.top);
177
177
  }
178
178
  }
179
179
  if (is.defined(image.top) !== is.defined(image.left)) {
@@ -113,8 +113,8 @@ const blend = {
113
113
  * @param {Boolean} [images[].autoOrient=false] - set to true to use EXIF orientation data, if present, to orient the image.
114
114
  * @param {String} [images[].blend='over'] - how to blend this image with the image below.
115
115
  * @param {String} [images[].gravity='centre'] - gravity at which to place the overlay.
116
- * @param {Number} [images[].top] - the pixel offset from the top edge.
117
- * @param {Number} [images[].left] - the pixel offset from the left edge.
116
+ * @param {Number} [images[].top] - the pixel offset from the top edge, an integer between -100000000 and 100000000.
117
+ * @param {Number} [images[].left] - the pixel offset from the left edge, an integer between -100000000 and 100000000.
118
118
  * @param {Boolean} [images[].tile=false] - set to true to repeat the overlay image across the entire image with the given `gravity`.
119
119
  * @param {Boolean} [images[].premultiplied=false] - set to true to avoid premultiplying the image below. Equivalent to the `--premultiplied` vips option.
120
120
  * @param {Number} [images[].density=72] - number representing the DPI for vector overlay image.
@@ -163,17 +163,17 @@ function composite (images) {
163
163
  }
164
164
  }
165
165
  if (is.defined(image.left)) {
166
- if (is.integer(image.left)) {
166
+ if (is.integer(image.left) && is.inRange(image.left, -100000000, 100000000)) {
167
167
  composite.left = image.left;
168
168
  } else {
169
- throw is.invalidParameterError('left', 'integer', image.left);
169
+ throw is.invalidParameterError('left', 'integer between -100000000 and 100000000', image.left);
170
170
  }
171
171
  }
172
172
  if (is.defined(image.top)) {
173
- if (is.integer(image.top)) {
173
+ if (is.integer(image.top) && is.inRange(image.top, -100000000, 100000000)) {
174
174
  composite.top = image.top;
175
175
  } else {
176
- throw is.invalidParameterError('top', 'integer', image.top);
176
+ throw is.invalidParameterError('top', 'integer between -100000000 and 100000000', image.top);
177
177
  }
178
178
  }
179
179
  if (is.defined(image.top) !== is.defined(image.left)) {
package/dist/index.d.cts CHANGED
@@ -1697,9 +1697,9 @@ declare namespace sharp {
1697
1697
  blend?: Blend | undefined;
1698
1698
  /** gravity at which to place the overlay. (optional, default 'centre') */
1699
1699
  gravity?: Gravity | undefined;
1700
- /** the pixel offset from the top edge. */
1700
+ /** the pixel offset from the top edge, an integer between -100000000 and 100000000. */
1701
1701
  top?: number | undefined;
1702
- /** the pixel offset from the left edge. */
1702
+ /** the pixel offset from the left edge, an integer between -100000000 and 100000000. */
1703
1703
  left?: number | undefined;
1704
1704
  /** set to true to repeat the overlay image across the entire image with the given gravity. (optional, default false) */
1705
1705
  tile?: boolean | undefined;
package/dist/index.d.mts CHANGED
@@ -1691,9 +1691,9 @@ export interface OverlayOptions extends SharpOptions {
1691
1691
  blend?: Blend | undefined;
1692
1692
  /** gravity at which to place the overlay. (optional, default 'centre') */
1693
1693
  gravity?: Gravity | undefined;
1694
- /** the pixel offset from the top edge. */
1694
+ /** the pixel offset from the top edge, an integer between -100000000 and 100000000. */
1695
1695
  top?: number | undefined;
1696
- /** the pixel offset from the left edge. */
1696
+ /** the pixel offset from the left edge, an integer between -100000000 and 100000000. */
1697
1697
  left?: number | undefined;
1698
1698
  /** set to true to repeat the overlay image across the entire image with the given gravity. (optional, default false) */
1699
1699
  tile?: boolean | undefined;
package/lib/index.d.ts CHANGED
@@ -1697,9 +1697,9 @@ declare namespace sharp {
1697
1697
  blend?: Blend | undefined;
1698
1698
  /** gravity at which to place the overlay. (optional, default 'centre') */
1699
1699
  gravity?: Gravity | undefined;
1700
- /** the pixel offset from the top edge. */
1700
+ /** the pixel offset from the top edge, an integer between -100000000 and 100000000. */
1701
1701
  top?: number | undefined;
1702
- /** the pixel offset from the left edge. */
1702
+ /** the pixel offset from the left edge, an integer between -100000000 and 100000000. */
1703
1703
  left?: number | undefined;
1704
1704
  /** set to true to repeat the overlay image across the entire image with the given gravity. (optional, default false) */
1705
1705
  tile?: boolean | undefined;
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-revizly42",
4
+ "version": "0.35.0-revizly43",
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.43",
167
- "@revizly/sharp-libvips-linux-x64": "1.0.43",
168
- "@revizly/sharp-linux-arm64": "0.35.0-revizly42",
169
- "@revizly/sharp-linux-x64": "0.35.0-revizly42"
166
+ "@revizly/sharp-libvips-linux-arm64": "1.0.44",
167
+ "@revizly/sharp-libvips-linux-x64": "1.0.44",
168
+ "@revizly/sharp-linux-arm64": "0.35.0-revizly43",
169
+ "@revizly/sharp-linux-x64": "0.35.0-revizly43"
170
170
  },
171
171
  "peerDependenciesMeta": {
172
172
  "@types/node": {
@@ -177,7 +177,7 @@
177
177
  "@biomejs/biome": "^2.5.1",
178
178
  "@cpplint/cli": "^0.1.0",
179
179
  "@emnapi/runtime": "^1.11.1",
180
- "@revizly/sharp-libvips-dev": "1.0.43",
180
+ "@revizly/sharp-libvips-dev": "1.0.44",
181
181
  "@types/node": "*",
182
182
  "emnapi": "^1.11.1",
183
183
  "exif-reader": "^2.0.3",
@@ -194,7 +194,7 @@
194
194
  "node": ">=20.9.0"
195
195
  },
196
196
  "config": {
197
- "libvips": ">=8.18.3"
197
+ "libvips": ">=8.18.4"
198
198
  },
199
199
  "funding": {
200
200
  "url": "https://opencollective.com/libvips"
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 < 3)
23
- #error "libvips version 8.18.3+ is required - please see https://sharp.pixelplumbing.com/install"
22
+ (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION == 18 && VIPS_MICRO_VERSION < 4)
23
+ #error "libvips version 8.18.4+ is required - please see https://sharp.pixelplumbing.com/install"
24
24
  #endif
25
25
 
26
26
  #if defined(__has_include)