@b4run/inspector 0.10.0 → 0.11.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.
Files changed (72) hide show
  1. package/.next/standalone/node_modules/.pnpm/{@img+sharp-libvips-linux-x64@1.3.2 → @img+sharp-libvips-linux-x64@1.3.3}/node_modules/@img/sharp-libvips-linux-x64/lib/glib-2.0/include/glibconfig.h +1 -1
  2. package/.next/standalone/node_modules/.pnpm/{@img+sharp-libvips-linux-x64@1.3.2/node_modules/@img/sharp-libvips-linux-x64/lib/libvips-cpp.so.8.18.3 → @img+sharp-libvips-linux-x64@1.3.3/node_modules/@img/sharp-libvips-linux-x64/lib/libvips-cpp.so.8.18.6} +0 -0
  3. package/.next/standalone/node_modules/.pnpm/{@img+sharp-libvips-linux-x64@1.3.2 → @img+sharp-libvips-linux-x64@1.3.3}/node_modules/@img/sharp-libvips-linux-x64/versions.json +13 -13
  4. package/.next/standalone/node_modules/.pnpm/{@img+sharp-linux-x64@0.35.3 → @img+sharp-linux-x64@0.35.4}/node_modules/@img/sharp-linux-x64/index.cjs +1 -1
  5. package/.next/standalone/node_modules/.pnpm/@img+sharp-linux-x64@0.35.4/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64-0.35.4.node +0 -0
  6. package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/composite.cjs +6 -6
  7. package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/composite.mjs +6 -6
  8. package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/constructor.cjs +1 -1
  9. package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/constructor.mjs +1 -1
  10. package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/index.d.cts +2 -2
  11. package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/index.d.mts +2 -2
  12. package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/input.cjs +20 -15
  13. package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/input.mjs +20 -15
  14. package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/operation.cjs +4 -0
  15. package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/operation.mjs +4 -0
  16. package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/output.cjs +4 -7
  17. package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/output.mjs +4 -7
  18. package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/resize.cjs +8 -8
  19. package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/resize.mjs +8 -8
  20. package/.next/standalone/packages/inspector/.next/BUILD_ID +1 -1
  21. package/.next/standalone/packages/inspector/.next/build-manifest.json +3 -3
  22. package/.next/standalone/packages/inspector/.next/prerender-manifest.json +3 -3
  23. package/.next/standalone/packages/inspector/.next/server/app/_global-error.html +1 -1
  24. package/.next/standalone/packages/inspector/.next/server/app/_global-error.rsc +1 -1
  25. package/.next/standalone/packages/inspector/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  26. package/.next/standalone/packages/inspector/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  27. package/.next/standalone/packages/inspector/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  28. package/.next/standalone/packages/inspector/.next/server/app/_not-found.html +1 -1
  29. package/.next/standalone/packages/inspector/.next/server/app/_not-found.rsc +1 -1
  30. package/.next/standalone/packages/inspector/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  31. package/.next/standalone/packages/inspector/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  32. package/.next/standalone/packages/inspector/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  33. package/.next/standalone/packages/inspector/.next/server/app/index.html +1 -1
  34. package/.next/standalone/packages/inspector/.next/server/app/index.rsc +1 -1
  35. package/.next/standalone/packages/inspector/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  36. package/.next/standalone/packages/inspector/.next/server/app/index.segments/_full.segment.rsc +1 -1
  37. package/.next/standalone/packages/inspector/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  38. package/.next/standalone/packages/inspector/.next/server/app/memory.html +1 -1
  39. package/.next/standalone/packages/inspector/.next/server/app/memory.rsc +1 -1
  40. package/.next/standalone/packages/inspector/.next/server/app/memory.segments/_full.segment.rsc +1 -1
  41. package/.next/standalone/packages/inspector/.next/server/app/memory.segments/_tree.segment.rsc +1 -1
  42. package/.next/standalone/packages/inspector/.next/server/app/memory.segments/memory/__PAGE__.segment.rsc +1 -1
  43. package/.next/standalone/packages/inspector/.next/server/middleware-build-manifest.js +3 -3
  44. package/.next/standalone/packages/inspector/.next/server/pages/404.html +1 -1
  45. package/.next/standalone/packages/inspector/.next/server/pages/500.html +1 -1
  46. package/.next/standalone/packages/inspector/.next/server/server-reference-manifest.js +1 -1
  47. package/.next/standalone/packages/inspector/.next/server/server-reference-manifest.json +1 -1
  48. package/.next/standalone/packages/inspector/package.json +1 -1
  49. package/package.json +4 -4
  50. package/.next/standalone/node_modules/.pnpm/@img+sharp-libvips-linux-x64@1.3.2/node_modules/@img/sharp-libvips-linux-x64/package.json +0 -43
  51. package/.next/standalone/node_modules/.pnpm/@img+sharp-linux-x64@0.35.3/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64-0.35.3.node +0 -0
  52. package/.next/standalone/node_modules/.pnpm/@img+sharp-linux-x64@0.35.3/node_modules/@img/sharp-linux-x64/package.json +0 -47
  53. package/.next/standalone/node_modules/.pnpm/sharp@0.35.3_@types+node@26.1.2/node_modules/sharp/package.json +0 -227
  54. /package/.next/standalone/node_modules/.pnpm/{@img+sharp-libvips-linux-x64@1.3.2 → @img+sharp-libvips-linux-x64@1.3.3}/node_modules/@img/sharp-libvips-linux-x64/README.md +0 -0
  55. /package/.next/standalone/node_modules/.pnpm/{@img+sharp-libvips-linux-x64@1.3.2 → @img+sharp-libvips-linux-x64@1.3.3}/node_modules/@img/sharp-libvips-linux-x64/lib/index.js +0 -0
  56. /package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/channel.cjs +0 -0
  57. /package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/channel.mjs +0 -0
  58. /package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/colour.cjs +0 -0
  59. /package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/colour.mjs +0 -0
  60. /package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/index.cjs +0 -0
  61. /package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/index.mjs +0 -0
  62. /package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/is.cjs +0 -0
  63. /package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/is.mjs +0 -0
  64. /package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/libvips.cjs +0 -0
  65. /package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/libvips.mjs +0 -0
  66. /package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/sharp.cjs +0 -0
  67. /package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/sharp.mjs +0 -0
  68. /package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/utility.cjs +0 -0
  69. /package/.next/standalone/node_modules/.pnpm/{sharp@0.35.3_@types+node@26.1.2 → sharp@0.35.4_@types+node@26.1.2}/node_modules/sharp/dist/utility.mjs +0 -0
  70. /package/.next/standalone/packages/inspector/.next/static/{Jx2bKsqmdBhr3KCn9xWQ_ → _OcayjuAulw1b289SDk4b}/_buildManifest.js +0 -0
  71. /package/.next/standalone/packages/inspector/.next/static/{Jx2bKsqmdBhr3KCn9xWQ_ → _OcayjuAulw1b289SDk4b}/_clientMiddlewareManifest.js +0 -0
  72. /package/.next/standalone/packages/inspector/.next/static/{Jx2bKsqmdBhr3KCn9xWQ_ → _OcayjuAulw1b289SDk4b}/_ssgManifest.js +0 -0
@@ -113,7 +113,7 @@ typedef unsigned long guintptr;
113
113
 
114
114
  #define GLIB_MAJOR_VERSION 2
115
115
  #define GLIB_MINOR_VERSION 89
116
- #define GLIB_MICRO_VERSION 1
116
+ #define GLIB_MICRO_VERSION 4
117
117
 
118
118
  #define G_OS_UNIX
119
119
 
@@ -1,29 +1,29 @@
1
1
  {
2
- "aom": "3.14.1",
3
- "archive": "3.8.8",
2
+ "aom": "3.15.0",
3
+ "archive": "3.8.9",
4
4
  "cairo": "1.18.4",
5
5
  "cgif": "0.5.3",
6
6
  "exif": "0.6.26",
7
- "expat": "2.8.2",
8
- "ffi": "3.6.0",
9
- "fontconfig": "2.18.1",
7
+ "expat": "2.8.3",
8
+ "ffi": "3.8.0",
9
+ "fontconfig": "2.18.3",
10
10
  "freetype": "2.14.3",
11
11
  "fribidi": "1.0.16",
12
- "glib": "2.89.1",
13
- "harfbuzz": "14.2.1",
14
- "heif": "1.23.1",
12
+ "glib": "2.89.4",
13
+ "harfbuzz": "14.3.1",
14
+ "heif": "1.23.2",
15
15
  "highway": "1.4.0",
16
16
  "imagequant": "2.4.1",
17
17
  "lcms": "2.19.1",
18
18
  "mozjpeg": "0826579",
19
- "pango": "1.58.0",
19
+ "pango": "1.58.2",
20
20
  "pixman": "0.46.4",
21
21
  "png": "1.6.58",
22
22
  "proxy-libintl": "0.5",
23
- "rsvg": "2.62.90",
24
- "tiff": "d01a94b",
25
- "uhdr": "1acdbed",
26
- "vips": "8.18.3",
23
+ "rsvg": "2.62.91",
24
+ "tiff": "4.7.2",
25
+ "uhdr": "2.0.2",
26
+ "vips": "8.18.6",
27
27
  "webp": "1.6.0",
28
28
  "xml2": "2.15.3",
29
29
  "zlib-ng": "2.3.3"
@@ -1,2 +1,2 @@
1
1
  try { require.resolve('@img/sharp-libvips-linux-x64/binary'); } catch {}
2
- module.exports = require('./lib/sharp-linux-x64-0.35.3.node');
2
+ module.exports = require('./lib/sharp-linux-x64-0.35.4.node');
@@ -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)) {
@@ -492,7 +492,7 @@ function clone () {
492
492
  clone.options.queueListener = queueListener;
493
493
  // Pass 'finish' event to clone for Stream-based input
494
494
  if (this._isStreamInput()) {
495
- this.on('finish', () => {
495
+ this._whenStreamInFinished(() => {
496
496
  // Clone inherits input data
497
497
  this._flattenBufferIn();
498
498
  clone.options.input.buffer = this.options.input.buffer;
@@ -492,7 +492,7 @@ function clone () {
492
492
  clone.options.queueListener = queueListener;
493
493
  // Pass 'finish' event to clone for Stream-based input
494
494
  if (this._isStreamInput()) {
495
- this.on('finish', () => {
495
+ this._whenStreamInFinished(() => {
496
496
  // Clone inherits input data
497
497
  this._flattenBufferIn();
498
498
  clone.options.input.buffer = this.options.input.buffer;
@@ -1693,9 +1693,9 @@ declare namespace sharp {
1693
1693
  blend?: Blend | undefined;
1694
1694
  /** gravity at which to place the overlay. (optional, default 'centre') */
1695
1695
  gravity?: Gravity | undefined;
1696
- /** the pixel offset from the top edge. */
1696
+ /** the pixel offset from the top edge, an integer between -100000000 and 100000000. */
1697
1697
  top?: number | undefined;
1698
- /** the pixel offset from the left edge. */
1698
+ /** the pixel offset from the left edge, an integer between -100000000 and 100000000. */
1699
1699
  left?: number | undefined;
1700
1700
  /** set to true to repeat the overlay image across the entire image with the given gravity. (optional, default false) */
1701
1701
  tile?: boolean | undefined;
@@ -1687,9 +1687,9 @@ export interface OverlayOptions extends SharpOptions {
1687
1687
  blend?: Blend | undefined;
1688
1688
  /** gravity at which to place the overlay. (optional, default 'centre') */
1689
1689
  gravity?: Gravity | undefined;
1690
- /** the pixel offset from the top edge. */
1690
+ /** the pixel offset from the top edge, an integer between -100000000 and 100000000. */
1691
1691
  top?: number | undefined;
1692
- /** the pixel offset from the left edge. */
1692
+ /** the pixel offset from the left edge, an integer between -100000000 and 100000000. */
1693
1693
  left?: number | undefined;
1694
1694
  /** set to true to repeat the overlay image across the entire image with the given gravity. (optional, default false) */
1695
1695
  tile?: boolean | undefined;
@@ -531,11 +531,6 @@ function _createInputDescriptor (input, inputOptions, containerOptions) {
531
531
  function _write (chunk, _encoding, callback) {
532
532
  if (Array.isArray(this.options.input.buffer)) {
533
533
  if (is.buffer(chunk)) {
534
- if (this.options.input.buffer.length === 0) {
535
- this.on('finish', () => {
536
- this.streamInFinished = true;
537
- });
538
- }
539
534
  this.options.input.buffer.push(chunk);
540
535
  callback();
541
536
  } else {
@@ -565,6 +560,20 @@ function _isStreamInput () {
565
560
  return Array.isArray(this.options.input.buffer);
566
561
  }
567
562
 
563
+ /**
564
+ * Call fn when the Writable side of Stream-based input has finished,
565
+ * or immediately when it already has, as 'finish' is emitted only once.
566
+ * @private
567
+ * @param {Function} fn
568
+ */
569
+ function _whenStreamInFinished (fn) {
570
+ if (this.writableFinished) {
571
+ fn();
572
+ } else {
573
+ this.once('finish', fn);
574
+ }
575
+ }
576
+
568
577
  /**
569
578
  * Fast access to (uncached) image metadata without decoding any compressed pixel data.
570
579
  *
@@ -642,7 +651,7 @@ function metadata (callback) {
642
651
  const stack = Error();
643
652
  if (is.fn(callback)) {
644
653
  if (this._isStreamInput()) {
645
- this.on('finish', () => {
654
+ this._whenStreamInFinished(() => {
646
655
  this._flattenBufferIn();
647
656
  sharp.metadata(this.options, (err, metadata) => {
648
657
  if (err) {
@@ -665,7 +674,7 @@ function metadata (callback) {
665
674
  } else {
666
675
  if (this._isStreamInput()) {
667
676
  return new Promise((resolve, reject) => {
668
- const finished = () => {
677
+ this._whenStreamInFinished(() => {
669
678
  this._flattenBufferIn();
670
679
  sharp.metadata(this.options, (err, metadata) => {
671
680
  if (err) {
@@ -674,12 +683,7 @@ function metadata (callback) {
674
683
  resolve(metadata);
675
684
  }
676
685
  });
677
- };
678
- if (this.writableFinished) {
679
- finished();
680
- } else {
681
- this.once('finish', finished);
682
- }
686
+ });
683
687
  });
684
688
  } else {
685
689
  return new Promise((resolve, reject) => {
@@ -744,7 +748,7 @@ function stats (callback) {
744
748
  const stack = Error();
745
749
  if (is.fn(callback)) {
746
750
  if (this._isStreamInput()) {
747
- this.on('finish', () => {
751
+ this._whenStreamInFinished(() => {
748
752
  this._flattenBufferIn();
749
753
  sharp.stats(this.options, (err, stats) => {
750
754
  if (err) {
@@ -767,7 +771,7 @@ function stats (callback) {
767
771
  } else {
768
772
  if (this._isStreamInput()) {
769
773
  return new Promise((resolve, reject) => {
770
- this.on('finish', function () {
774
+ this._whenStreamInFinished(() => {
771
775
  this._flattenBufferIn();
772
776
  sharp.stats(this.options, (err, stats) => {
773
777
  if (err) {
@@ -805,6 +809,7 @@ module.exports = (Sharp) => {
805
809
  _write,
806
810
  _flattenBufferIn,
807
811
  _isStreamInput,
812
+ _whenStreamInFinished,
808
813
  // Public
809
814
  metadata,
810
815
  stats
@@ -531,11 +531,6 @@ function _createInputDescriptor (input, inputOptions, containerOptions) {
531
531
  function _write (chunk, _encoding, callback) {
532
532
  if (Array.isArray(this.options.input.buffer)) {
533
533
  if (is.buffer(chunk)) {
534
- if (this.options.input.buffer.length === 0) {
535
- this.on('finish', () => {
536
- this.streamInFinished = true;
537
- });
538
- }
539
534
  this.options.input.buffer.push(chunk);
540
535
  callback();
541
536
  } else {
@@ -565,6 +560,20 @@ function _isStreamInput () {
565
560
  return Array.isArray(this.options.input.buffer);
566
561
  }
567
562
 
563
+ /**
564
+ * Call fn when the Writable side of Stream-based input has finished,
565
+ * or immediately when it already has, as 'finish' is emitted only once.
566
+ * @private
567
+ * @param {Function} fn
568
+ */
569
+ function _whenStreamInFinished (fn) {
570
+ if (this.writableFinished) {
571
+ fn();
572
+ } else {
573
+ this.once('finish', fn);
574
+ }
575
+ }
576
+
568
577
  /**
569
578
  * Fast access to (uncached) image metadata without decoding any compressed pixel data.
570
579
  *
@@ -642,7 +651,7 @@ function metadata (callback) {
642
651
  const stack = Error();
643
652
  if (is.fn(callback)) {
644
653
  if (this._isStreamInput()) {
645
- this.on('finish', () => {
654
+ this._whenStreamInFinished(() => {
646
655
  this._flattenBufferIn();
647
656
  sharp.metadata(this.options, (err, metadata) => {
648
657
  if (err) {
@@ -665,7 +674,7 @@ function metadata (callback) {
665
674
  } else {
666
675
  if (this._isStreamInput()) {
667
676
  return new Promise((resolve, reject) => {
668
- const finished = () => {
677
+ this._whenStreamInFinished(() => {
669
678
  this._flattenBufferIn();
670
679
  sharp.metadata(this.options, (err, metadata) => {
671
680
  if (err) {
@@ -674,12 +683,7 @@ function metadata (callback) {
674
683
  resolve(metadata);
675
684
  }
676
685
  });
677
- };
678
- if (this.writableFinished) {
679
- finished();
680
- } else {
681
- this.once('finish', finished);
682
- }
686
+ });
683
687
  });
684
688
  } else {
685
689
  return new Promise((resolve, reject) => {
@@ -744,7 +748,7 @@ function stats (callback) {
744
748
  const stack = Error();
745
749
  if (is.fn(callback)) {
746
750
  if (this._isStreamInput()) {
747
- this.on('finish', () => {
751
+ this._whenStreamInFinished(() => {
748
752
  this._flattenBufferIn();
749
753
  sharp.stats(this.options, (err, stats) => {
750
754
  if (err) {
@@ -767,7 +771,7 @@ function stats (callback) {
767
771
  } else {
768
772
  if (this._isStreamInput()) {
769
773
  return new Promise((resolve, reject) => {
770
- this.on('finish', function () {
774
+ this._whenStreamInFinished(() => {
771
775
  this._flattenBufferIn();
772
776
  sharp.stats(this.options, (err, stats) => {
773
777
  if (err) {
@@ -805,6 +809,7 @@ export default (Sharp) => {
805
809
  _write,
806
810
  _flattenBufferIn,
807
811
  _isStreamInput,
812
+ _whenStreamInFinished,
808
813
  // Public
809
814
  metadata,
810
815
  stats
@@ -78,6 +78,10 @@ function rotate (angle, options) {
78
78
  * Auto-orient based on the EXIF `Orientation` tag, then remove the tag.
79
79
  * Mirroring is supported and may infer the use of a flip operation.
80
80
  *
81
+ * Only the EXIF `Orientation` tag is considered; orientation carried in other
82
+ * places, such as an XMP `tiff:Orientation` element, is left untouched and
83
+ * remains the responsibility of the consumer.
84
+ *
81
85
  * Previous or subsequent use of `rotate(angle)` and either `flip()` or `flop()`
82
86
  * will logically occur after auto-orientation, regardless of call order.
83
87
  *
@@ -78,6 +78,10 @@ function rotate (angle, options) {
78
78
  * Auto-orient based on the EXIF `Orientation` tag, then remove the tag.
79
79
  * Mirroring is supported and may infer the use of a flip operation.
80
80
  *
81
+ * Only the EXIF `Orientation` tag is considered; orientation carried in other
82
+ * places, such as an XMP `tiff:Orientation` element, is left untouched and
83
+ * remains the responsibility of the consumer.
84
+ *
81
85
  * Previous or subsequent use of `rotate(angle)` and either `flip()` or `flop()`
82
86
  * will logically occur after auto-orientation, regardless of call order.
83
87
  *
@@ -33,7 +33,7 @@ const jp2Regex = /\.(jp[2x]|j2[kc])$/i;
33
33
 
34
34
  const errJp2Save = () => new Error('JP2 output requires libvips with support for OpenJPEG');
35
35
 
36
- const bitdepthFromColourCount = (colours) => 1 << 31 - Math.clz32(Math.ceil(Math.log2(colours)));
36
+ const bitdepthFromColourCount = (colours) => 1 << 32 - Math.clz32(Math.ceil(Math.log2(colours)) - 1);
37
37
 
38
38
  /**
39
39
  * Write output image data to a file.
@@ -1649,7 +1649,7 @@ function _pipeline (callback, stack) {
1649
1649
  // output=file/buffer
1650
1650
  if (this._isStreamInput()) {
1651
1651
  // output=file/buffer, input=stream
1652
- this.on('finish', () => {
1652
+ this._whenStreamInFinished(() => {
1653
1653
  this._flattenBufferIn();
1654
1654
  sharp.pipeline(this.options, (err, data, info) => {
1655
1655
  if (err) {
@@ -1674,7 +1674,7 @@ function _pipeline (callback, stack) {
1674
1674
  // output=stream
1675
1675
  if (this._isStreamInput()) {
1676
1676
  // output=stream, input=stream
1677
- this.once('finish', () => {
1677
+ this._whenStreamInFinished(() => {
1678
1678
  this._flattenBufferIn();
1679
1679
  sharp.pipeline(this.options, (err, data, info) => {
1680
1680
  if (err) {
@@ -1687,9 +1687,6 @@ function _pipeline (callback, stack) {
1687
1687
  this.on('end', () => this.emit('close'));
1688
1688
  });
1689
1689
  });
1690
- if (this.streamInFinished) {
1691
- this.emit('finish');
1692
- }
1693
1690
  } else {
1694
1691
  // output=stream, input=file/buffer
1695
1692
  sharp.pipeline(this.options, (err, data, info) => {
@@ -1709,7 +1706,7 @@ function _pipeline (callback, stack) {
1709
1706
  if (this._isStreamInput()) {
1710
1707
  // output=promise, input=stream
1711
1708
  return new Promise((resolve, reject) => {
1712
- this.once('finish', () => {
1709
+ this._whenStreamInFinished(() => {
1713
1710
  this._flattenBufferIn();
1714
1711
  sharp.pipeline(this.options, (err, data, info) => {
1715
1712
  if (err) {
@@ -33,7 +33,7 @@ const jp2Regex = /\.(jp[2x]|j2[kc])$/i;
33
33
 
34
34
  const errJp2Save = () => new Error('JP2 output requires libvips with support for OpenJPEG');
35
35
 
36
- const bitdepthFromColourCount = (colours) => 1 << 31 - Math.clz32(Math.ceil(Math.log2(colours)));
36
+ const bitdepthFromColourCount = (colours) => 1 << 32 - Math.clz32(Math.ceil(Math.log2(colours)) - 1);
37
37
 
38
38
  /**
39
39
  * Write output image data to a file.
@@ -1649,7 +1649,7 @@ function _pipeline (callback, stack) {
1649
1649
  // output=file/buffer
1650
1650
  if (this._isStreamInput()) {
1651
1651
  // output=file/buffer, input=stream
1652
- this.on('finish', () => {
1652
+ this._whenStreamInFinished(() => {
1653
1653
  this._flattenBufferIn();
1654
1654
  sharp.pipeline(this.options, (err, data, info) => {
1655
1655
  if (err) {
@@ -1674,7 +1674,7 @@ function _pipeline (callback, stack) {
1674
1674
  // output=stream
1675
1675
  if (this._isStreamInput()) {
1676
1676
  // output=stream, input=stream
1677
- this.once('finish', () => {
1677
+ this._whenStreamInFinished(() => {
1678
1678
  this._flattenBufferIn();
1679
1679
  sharp.pipeline(this.options, (err, data, info) => {
1680
1680
  if (err) {
@@ -1687,9 +1687,6 @@ function _pipeline (callback, stack) {
1687
1687
  this.on('end', () => this.emit('close'));
1688
1688
  });
1689
1689
  });
1690
- if (this.streamInFinished) {
1691
- this.emit('finish');
1692
- }
1693
1690
  } else {
1694
1691
  // output=stream, input=file/buffer
1695
1692
  sharp.pipeline(this.options, (err, data, info) => {
@@ -1709,7 +1706,7 @@ function _pipeline (callback, stack) {
1709
1706
  if (this._isStreamInput()) {
1710
1707
  // output=promise, input=stream
1711
1708
  return new Promise((resolve, reject) => {
1712
- this.once('finish', () => {
1709
+ this._whenStreamInFinished(() => {
1713
1710
  this._flattenBufferIn();
1714
1711
  sharp.pipeline(this.options, (err, data, info) => {
1715
1712
  if (err) {
@@ -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 > 0) {
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 > 0) {
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 > 0) {
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 > 0) {
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
@@ -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 > 0) {
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 > 0) {
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 > 0) {
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 > 0) {
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
@@ -1 +1 @@
1
- Jx2bKsqmdBhr3KCn9xWQ_
1
+ _OcayjuAulw1b289SDk4b
@@ -7,9 +7,9 @@
7
7
  "static/chunks/0cz1d0mv5g_q7.js"
8
8
  ],
9
9
  "lowPriorityFiles": [
10
- "static/Jx2bKsqmdBhr3KCn9xWQ_/_buildManifest.js",
11
- "static/Jx2bKsqmdBhr3KCn9xWQ_/_ssgManifest.js",
12
- "static/Jx2bKsqmdBhr3KCn9xWQ_/_clientMiddlewareManifest.js"
10
+ "static/_OcayjuAulw1b289SDk4b/_buildManifest.js",
11
+ "static/_OcayjuAulw1b289SDk4b/_ssgManifest.js",
12
+ "static/_OcayjuAulw1b289SDk4b/_clientMiddlewareManifest.js"
13
13
  ],
14
14
  "rootMainFiles": [
15
15
  "static/chunks/23y7_dpbh3v59.js",
@@ -118,8 +118,8 @@
118
118
  "dynamicRoutes": {},
119
119
  "notFoundRoutes": [],
120
120
  "preview": {
121
- "previewModeId": "9317fb3e23b6705d4869c4b37d2de613",
122
- "previewModeSigningKey": "157e0ebbb9ce0bb47639ac2710b9b364d51af50e43d3011030b48f6d1309feac",
123
- "previewModeEncryptionKey": "63d2dacdc97467b8e5a69ab2f6f55f2ddc0922e0974cca2c2f2fd615c88dd96b"
121
+ "previewModeId": "d95fdb30bfdb3042394593db4ea534c9",
122
+ "previewModeSigningKey": "031fcd2a324dd24eebfcd5aca0f4b3ecdeddcec2d84a3bffb9b0217fa95170b1",
123
+ "previewModeEncryptionKey": "12cfb81740669f0828e634a2c9f379cb283f0e7d5944529a77cb7119a5f6905c"
124
124
  }
125
125
  }