canopycms-cdk 0.0.67-int.90 → 0.0.67

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 (48) hide show
  1. package/dist/constructs/asset-support.d.ts +137 -269
  2. package/dist/constructs/asset-support.js +275 -455
  3. package/dist/constructs/cms-distribution.d.ts +23 -40
  4. package/dist/constructs/cms-distribution.js +61 -88
  5. package/dist/constructs/cms-service.d.ts +38 -60
  6. package/dist/constructs/cms-service.js +246 -390
  7. package/dist/constructs/lambda-execution-role.d.ts +23 -39
  8. package/dist/constructs/lambda-execution-role.js +37 -60
  9. package/dist/index.js +0 -2
  10. package/dist/worker.d.ts +0 -2
  11. package/dist/worker.js +0 -2
  12. package/lambda/asset-transform/dist/handler.js +33 -49
  13. package/lambda/asset-transform/dist/node_modules/.package-lock.json +38 -38
  14. package/lambda/asset-transform/dist/node_modules/@img/sharp-libvips-linux-arm64/README.md +1 -1
  15. package/lambda/asset-transform/dist/node_modules/@img/sharp-libvips-linux-arm64/lib/glib-2.0/include/glibconfig.h +2 -2
  16. package/lambda/asset-transform/dist/node_modules/@img/sharp-libvips-linux-arm64/lib/{libvips-cpp.so.8.18.6 → libvips-cpp.so.8.18.7} +0 -0
  17. package/lambda/asset-transform/dist/node_modules/@img/sharp-libvips-linux-arm64/package.json +2 -2
  18. package/lambda/asset-transform/dist/node_modules/@img/sharp-libvips-linux-arm64/versions.json +11 -11
  19. package/lambda/asset-transform/dist/node_modules/@img/sharp-linux-arm64/index.cjs +1 -1
  20. package/lambda/asset-transform/dist/node_modules/@img/sharp-linux-arm64/lib/{sharp-linux-arm64-0.35.4.node → sharp-linux-arm64-0.35.5.node} +0 -0
  21. package/lambda/asset-transform/dist/node_modules/@img/sharp-linux-arm64/package.json +2 -2
  22. package/lambda/asset-transform/dist/node_modules/@img/sharp-wasm32/index.cjs +1 -1
  23. package/lambda/asset-transform/dist/node_modules/@img/sharp-wasm32/lib/sharp-wasm32-0.35.5.node.js +1 -0
  24. package/lambda/asset-transform/dist/node_modules/@img/sharp-wasm32/lib/{sharp-wasm32-0.35.4.node.wasm → sharp-wasm32-0.35.5.node.wasm} +0 -0
  25. package/lambda/asset-transform/dist/node_modules/@img/sharp-wasm32/package.json +1 -1
  26. package/lambda/asset-transform/dist/node_modules/@img/sharp-wasm32/versions.json +7 -7
  27. package/lambda/asset-transform/dist/node_modules/sharp/dist/index.d.cts +2 -2
  28. package/lambda/asset-transform/dist/node_modules/sharp/dist/index.d.mts +3 -3
  29. package/lambda/asset-transform/dist/node_modules/sharp/dist/is.cjs +8 -2
  30. package/lambda/asset-transform/dist/node_modules/sharp/dist/is.mjs +8 -2
  31. package/lambda/asset-transform/dist/node_modules/sharp/dist/operation.cjs +2 -2
  32. package/lambda/asset-transform/dist/node_modules/sharp/dist/operation.mjs +2 -2
  33. package/lambda/asset-transform/dist/node_modules/sharp/dist/output.cjs +1 -0
  34. package/lambda/asset-transform/dist/node_modules/sharp/dist/output.mjs +1 -0
  35. package/lambda/asset-transform/dist/node_modules/sharp/dist/resize.cjs +14 -14
  36. package/lambda/asset-transform/dist/node_modules/sharp/dist/resize.mjs +14 -14
  37. package/lambda/asset-transform/dist/node_modules/sharp/dist/sharp.cjs +3 -3
  38. package/lambda/asset-transform/dist/node_modules/sharp/dist/sharp.mjs +3 -3
  39. package/lambda/asset-transform/dist/node_modules/sharp/lib/index.d.ts +2 -2
  40. package/lambda/asset-transform/dist/node_modules/sharp/package.json +35 -35
  41. package/lambda/asset-transform/dist/node_modules/sharp/src/binding.gyp +1 -1
  42. package/lambda/asset-transform/dist/node_modules/sharp/src/common.cc +4 -4
  43. package/lambda/asset-transform/dist/node_modules/sharp/src/common.h +2 -2
  44. package/lambda/asset-transform/dist/node_modules/sharp/src/pipeline.cc +31 -6
  45. package/lambda/asset-transform/dist/node_modules/sharp/src/utilities.cc +1 -1
  46. package/package.json +4 -4
  47. package/worker/dist/index.js +251 -364
  48. package/lambda/asset-transform/dist/node_modules/@img/sharp-wasm32/lib/sharp-wasm32-0.35.4.node.js +0 -1
@@ -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);
@@ -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);
@@ -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(
@@ -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(
@@ -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
 
@@ -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",
4
+ "version": "0.35.5",
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",
167
- "@img/sharp-darwin-x64": "0.35.4",
168
- "@img/sharp-freebsd-wasm32": "0.35.4",
169
- "@img/sharp-libvips-darwin-arm64": "1.3.3",
170
- "@img/sharp-libvips-darwin-x64": "1.3.3",
171
- "@img/sharp-libvips-linux-arm": "1.3.3",
172
- "@img/sharp-libvips-linux-arm64": "1.3.3",
173
- "@img/sharp-libvips-linux-ppc64": "1.3.3",
174
- "@img/sharp-libvips-linux-riscv64": "1.3.3",
175
- "@img/sharp-libvips-linux-s390x": "1.3.3",
176
- "@img/sharp-libvips-linux-x64": "1.3.3",
177
- "@img/sharp-libvips-linuxmusl-arm64": "1.3.3",
178
- "@img/sharp-libvips-linuxmusl-x64": "1.3.3",
179
- "@img/sharp-linux-arm": "0.35.4",
180
- "@img/sharp-linux-arm64": "0.35.4",
181
- "@img/sharp-linux-ppc64": "0.35.4",
182
- "@img/sharp-linux-riscv64": "0.35.4",
183
- "@img/sharp-linux-s390x": "0.35.4",
184
- "@img/sharp-linux-x64": "0.35.4",
185
- "@img/sharp-linuxmusl-arm64": "0.35.4",
186
- "@img/sharp-linuxmusl-x64": "0.35.4",
187
- "@img/sharp-webcontainers-wasm32": "0.35.4",
188
- "@img/sharp-win32-arm64": "0.35.4",
189
- "@img/sharp-win32-ia32": "0.35.4",
190
- "@img/sharp-win32-x64": "0.35.4"
166
+ "@img/sharp-darwin-arm64": "0.35.5",
167
+ "@img/sharp-darwin-x64": "0.35.5",
168
+ "@img/sharp-freebsd-wasm32": "0.35.5",
169
+ "@img/sharp-libvips-darwin-arm64": "1.3.4",
170
+ "@img/sharp-libvips-darwin-x64": "1.3.4",
171
+ "@img/sharp-libvips-linux-arm": "1.3.4",
172
+ "@img/sharp-libvips-linux-arm64": "1.3.4",
173
+ "@img/sharp-libvips-linux-ppc64": "1.3.4",
174
+ "@img/sharp-libvips-linux-riscv64": "1.3.4",
175
+ "@img/sharp-libvips-linux-s390x": "1.3.4",
176
+ "@img/sharp-libvips-linux-x64": "1.3.4",
177
+ "@img/sharp-libvips-linuxmusl-arm64": "1.3.4",
178
+ "@img/sharp-libvips-linuxmusl-x64": "1.3.4",
179
+ "@img/sharp-linux-arm": "0.35.5",
180
+ "@img/sharp-linux-arm64": "0.35.5",
181
+ "@img/sharp-linux-ppc64": "0.35.5",
182
+ "@img/sharp-linux-riscv64": "0.35.5",
183
+ "@img/sharp-linux-s390x": "0.35.5",
184
+ "@img/sharp-linux-x64": "0.35.5",
185
+ "@img/sharp-linuxmusl-arm64": "0.35.5",
186
+ "@img/sharp-linuxmusl-x64": "0.35.5",
187
+ "@img/sharp-webcontainers-wasm32": "0.35.5",
188
+ "@img/sharp-win32-arm64": "0.35.5",
189
+ "@img/sharp-win32-ia32": "0.35.5",
190
+ "@img/sharp-win32-x64": "0.35.5"
191
191
  },
192
192
  "peerDependenciesMeta": {
193
193
  "@types/node": {
@@ -195,31 +195,31 @@
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",
202
- "@img/sharp-libvips-dev-wasm32": "1.3.3",
203
- "@img/sharp-libvips-win32-arm64": "1.3.3",
204
- "@img/sharp-libvips-win32-ia32": "1.3.3",
205
- "@img/sharp-libvips-win32-x64": "1.3.3",
201
+ "@img/sharp-libvips-dev": "1.3.4",
202
+ "@img/sharp-libvips-dev-wasm32": "1.3.4",
203
+ "@img/sharp-libvips-win32-arm64": "1.3.4",
204
+ "@img/sharp-libvips-win32-ia32": "1.3.4",
205
+ "@img/sharp-libvips-win32-x64": "1.3.4",
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": {
219
219
  "node": ">=20.9.0"
220
220
  },
221
221
  "config": {
222
- "libvips": ">=8.18.6"
222
+ "libvips": ">=8.18.7"
223
223
  },
224
224
  "funding": {
225
225
  "url": "https://opencollective.com/libvips"
@@ -1,7 +1,7 @@
1
1
  # Copyright 2013 Lovell Fuller and others.
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
 
4
- {
4
+ { # noqa: B018
5
5
  'variables': {
6
6
  'vips_version': '<!(node -p "require(\'../dist/libvips.cjs\').minimumLibvipsVersion")',
7
7
  'platform_and_arch': '<!(node -p "require(\'../dist/libvips.cjs\').buildPlatformArch()")',
@@ -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);
@@ -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 < 6)
23
- #error "libvips version 8.18.6+ is required - please see https://sharp.pixelplumbing.com/install"
22
+ (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION == 18 && VIPS_MICRO_VERSION < 7)
23
+ #error "libvips version 8.18.7+ is required - please see https://sharp.pixelplumbing.com/install"
24
24
  #endif
25
25
 
26
26
  #if defined(__has_include)
@@ -56,9 +56,9 @@ class PipelineWorker : public Napi::AsyncWorker {
56
56
  hasAlpha |= image.has_alpha();
57
57
  }
58
58
  if (hasAlpha) {
59
- for (auto &image : images) {
60
- if (!image.has_alpha()) {
61
- image = sharp::EnsureAlpha(image, 1);
59
+ for (size_t i = 0; i < images.size(); i++) {
60
+ if (!images[i].has_alpha()) {
61
+ images[i] = sharp::EnsureAlpha(images[i], 1);
62
62
  }
63
63
  }
64
64
  } else {
@@ -94,7 +94,10 @@ class PipelineWorker : public Napi::AsyncWorker {
94
94
  // Calculate angle of rotation
95
95
  VipsAngle rotation = VIPS_ANGLE_D0;
96
96
  VipsAngle autoRotation = VIPS_ANGLE_D0;
97
+ VipsAngle gainMapRotation = VIPS_ANGLE_D0;
97
98
  bool autoFlop = false;
99
+ bool gainMapFlip = false;
100
+ bool gainMapFlop = false;
98
101
 
99
102
  if (baton->input->autoOrient) {
100
103
  // Rotate and flip image according to Exif orientation
@@ -115,11 +118,13 @@ class PipelineWorker : public Napi::AsyncWorker {
115
118
  MultiPageUnsupported(nPages, "Rotate");
116
119
  }
117
120
  image = image.rot(autoRotation);
121
+ gainMapRotation = autoRotation;
118
122
  autoRotation = VIPS_ANGLE_D0;
119
123
  }
120
124
  if (autoFlop) {
121
125
  image = image.flip(VIPS_DIRECTION_HORIZONTAL);
122
126
  autoFlop = false;
127
+ gainMapFlop = true;
123
128
  }
124
129
  }
125
130
 
@@ -128,20 +133,24 @@ class PipelineWorker : public Napi::AsyncWorker {
128
133
  if (baton->flip) {
129
134
  image = image.flip(VIPS_DIRECTION_VERTICAL);
130
135
  baton->flip = false;
136
+ gainMapFlip = true;
131
137
  }
132
138
  if (baton->flop) {
133
139
  image = image.flip(VIPS_DIRECTION_HORIZONTAL);
134
140
  baton->flop = false;
141
+ gainMapFlop = true;
135
142
  }
136
143
  if (rotation != VIPS_ANGLE_D0) {
137
144
  if (rotation != VIPS_ANGLE_D180) {
138
145
  MultiPageUnsupported(nPages, "Rotate");
139
146
  }
140
147
  image = image.rot(rotation);
148
+ gainMapRotation = rotation;
141
149
  rotation = VIPS_ANGLE_D0;
142
150
  }
143
151
  if (baton->rotationAngle != 0.0) {
144
152
  MultiPageUnsupported(nPages, "Rotate");
153
+ KeepGainMapUnsupported(baton->keepGainMap, "Rotate");
145
154
  std::vector<double> background;
146
155
  std::tie(image, background) = sharp::ApplyAlpha(image, baton->rotationBackground, false);
147
156
  image = image.rotate(baton->rotationAngle, VImage::option()->set("background", background)).copy_memory();
@@ -152,6 +161,7 @@ class PipelineWorker : public Napi::AsyncWorker {
152
161
  // Trim
153
162
  if (baton->trimThreshold >= 0.0) {
154
163
  MultiPageUnsupported(nPages, "Trim");
164
+ KeepGainMapUnsupported(baton->keepGainMap, "Trim");
155
165
  image = sharp::StaySequential(image);
156
166
  image = sharp::Trim(image, baton->trimBackground, baton->trimThreshold, baton->trimLineArt, baton->trimMargin);
157
167
  baton->trimOffsetLeft = image.xoffset();
@@ -306,6 +316,20 @@ class PipelineWorker : public Napi::AsyncWorker {
306
316
  if (image.get_typeof("gainmap-scale-factor") == G_TYPE_INT) {
307
317
  gainMapScaleFactor = image.get_int("gainmap-scale-factor");
308
318
  }
319
+ if (gainMapFlip) {
320
+ gainMap = gainMap.flip(VIPS_DIRECTION_VERTICAL);
321
+ }
322
+ if (gainMapFlop) {
323
+ gainMap = gainMap.flip(VIPS_DIRECTION_HORIZONTAL);
324
+ }
325
+ if (gainMapRotation != VIPS_ANGLE_D0) {
326
+ gainMap = gainMap.rot(gainMapRotation);
327
+ }
328
+ if (baton->topOffsetPre != -1) {
329
+ gainMap = gainMap.extract_area(
330
+ baton->leftOffsetPre / gainMapScaleFactor, baton->topOffsetPre / gainMapScaleFactor,
331
+ baton->widthPre / gainMapScaleFactor, baton->heightPre / gainMapScaleFactor);
332
+ }
309
333
  } else if (baton->withGainMap) {
310
334
  image = image.uhdr2scRGB();
311
335
  }
@@ -429,14 +453,14 @@ class PipelineWorker : public Napi::AsyncWorker {
429
453
  }
430
454
  image = image.rot(autoRotation);
431
455
  if (baton->keepGainMap) {
432
- gainMap = gainMap.rot(autoRotation);
456
+ gainMap = sharp::StaySequential(gainMap).rot(autoRotation);
433
457
  }
434
458
  }
435
459
  // Mirror vertically (up-down) about the x-axis
436
460
  if (baton->flip) {
437
461
  image = image.flip(VIPS_DIRECTION_VERTICAL);
438
462
  if (baton->keepGainMap) {
439
- gainMap = gainMap.flip(VIPS_DIRECTION_VERTICAL);
463
+ gainMap = sharp::StaySequential(gainMap).flip(VIPS_DIRECTION_VERTICAL);
440
464
  }
441
465
  }
442
466
  // Mirror horizontally (left-right) about the y-axis
@@ -453,7 +477,7 @@ class PipelineWorker : public Napi::AsyncWorker {
453
477
  }
454
478
  image = image.rot(rotation);
455
479
  if (baton->keepGainMap) {
456
- gainMap = gainMap.rot(rotation);
480
+ gainMap = sharp::StaySequential(gainMap).rot(rotation);
457
481
  }
458
482
  }
459
483
 
@@ -557,6 +581,7 @@ class PipelineWorker : public Napi::AsyncWorker {
557
581
  // Rotate post-extract non-90 angle
558
582
  if (!baton->rotateBefore && baton->rotationAngle != 0.0) {
559
583
  MultiPageUnsupported(nPages, "Rotate");
584
+ KeepGainMapUnsupported(baton->keepGainMap, "Rotate");
560
585
  image = sharp::StaySequential(image);
561
586
  std::vector<double> background;
562
587
  std::tie(image, background) = sharp::ApplyAlpha(image, baton->rotationBackground, shouldPremultiplyAlpha);
@@ -133,7 +133,7 @@ Napi::Value format(const Napi::CallbackInfo& info) {
133
133
  input.Set("file", hasInputFile);
134
134
  input.Set("buffer", hasInputBuffer);
135
135
  input.Set("stream", hasInputBuffer);
136
- if (hasInputFile) {
136
+ if (oc) {
137
137
  const VipsForeignClass *fc = VIPS_FOREIGN_CLASS(oc);
138
138
  if (fc->suffs) {
139
139
  Napi::Array fileSuffix = Napi::Array::New(env);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "canopycms-cdk",
3
- "version": "0.0.67-int.90",
3
+ "version": "0.0.67",
4
4
  "description": "AWS CDK constructs and EC2 worker for CanopyCMS deployment",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -31,7 +31,7 @@
31
31
  "peerDependencies": {
32
32
  "aws-cdk-lib": "^2.260.0",
33
33
  "constructs": "^10.0.0",
34
- "canopycms": "0.0.67-int.90"
34
+ "canopycms": "0.0.67"
35
35
  },
36
36
  "peerDependenciesMeta": {
37
37
  "aws-cdk-lib": {
@@ -56,8 +56,8 @@
56
56
  "tsx": "^4.19.0",
57
57
  "typescript": "^5.6.3",
58
58
  "vitest": "^4.1.0",
59
- "canopycms-auth-clerk": "0.0.67-int.90",
60
- "canopycms": "0.0.67-int.90"
59
+ "canopycms": "0.0.67",
60
+ "canopycms-auth-clerk": "0.0.67"
61
61
  },
62
62
  "scripts": {
63
63
  "build": "rm -rf dist && tsc && node ../../scripts/add-js-extensions.mjs dist",