openportal 0.1.0 → 0.1.1

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 (99) hide show
  1. package/package.json +10 -4
  2. package/web/.next/static/{b-zSCTvx5IzLyCj7s91p4 → A7pW-dtFIbPCSkvE8uenX}/_buildManifest.js +5 -5
  3. package/web/.next/static/chunks/{d3520c0622de77ff.js → 2e7bfb90c343ca96.js} +2 -2
  4. package/web/.next/static/chunks/{c2c14edbf40dd531.js → 8f80b41262ef70b6.js} +1 -1
  5. package/web/.next/static/chunks/{6ed981794a42d949.js → 967a1e0002fe9ae6.js} +2 -2
  6. package/web/.next/static/chunks/{688448a61fbd7d50.js → 9b265e2198b5525f.js} +2 -2
  7. package/web/.next/static/chunks/{c617a4c7a78d4946.js → aebf799dac29fe08.js} +2 -2
  8. package/web/.next/static/chunks/{d091e73f46572c38.js → c20ae04df8cc28be.js} +2 -2
  9. package/web/.next/static/chunks/{fe47781ce8074a57.js → d316d63225992c76.js} +2 -2
  10. package/web/.next/static/chunks/{turbopack-f44fd3803d0d6727.js → turbopack-1837909a677d116b.js} +1 -1
  11. package/web/.next/static/chunks/{turbopack-03c9848eaf268db1.js → turbopack-26688626142ac58f.js} +1 -1
  12. package/web/.next/static/chunks/{turbopack-bc49f2e78bf92fdb.js → turbopack-27558c851386934e.js} +1 -1
  13. package/web/.next/static/chunks/{turbopack-d90c5e114da5fc51.js → turbopack-92c911b9efda2756.js} +1 -1
  14. package/web/.next/static/chunks/{turbopack-ededbd49a3a234ea.js → turbopack-c40ec6674624f1d7.js} +1 -1
  15. package/web/.next/static/chunks/{turbopack-b3b62a2520d01d7e.js → turbopack-f4c0881f9723f5a5.js} +1 -1
  16. package/web/apps/web/.next/BUILD_ID +1 -1
  17. package/web/apps/web/.next/build-manifest.json +14 -14
  18. package/web/apps/web/.next/required-server-files.json +1 -1
  19. package/web/apps/web/.next/server/middleware-build-manifest.js +12 -12
  20. package/web/apps/web/.next/server/pages/404.html +1 -1
  21. package/web/apps/web/.next/server/pages/500.html +1 -1
  22. package/web/apps/web/.next/server/pages/_app/build-manifest.json +2 -2
  23. package/web/apps/web/.next/server/pages/_app/client-build-manifest.json +1 -1
  24. package/web/apps/web/.next/server/pages/_error/build-manifest.json +2 -2
  25. package/web/apps/web/.next/server/pages/_error/client-build-manifest.json +1 -1
  26. package/web/apps/web/.next/server/pages/index/build-manifest.json +2 -2
  27. package/web/apps/web/.next/server/pages/index/client-build-manifest.json +1 -1
  28. package/web/apps/web/.next/server/pages/index.html +1 -1
  29. package/web/apps/web/.next/server/pages/session/[id]/build-manifest.json +2 -2
  30. package/web/apps/web/.next/server/pages/session/[id]/client-build-manifest.json +1 -1
  31. package/web/apps/web/.next/server/pages/session/[id].html +1 -1
  32. package/web/apps/web/.next/server/pages/settings/build-manifest.json +2 -2
  33. package/web/apps/web/.next/server/pages/settings/client-build-manifest.json +1 -1
  34. package/web/apps/web/.next/server/pages/settings.html +1 -1
  35. package/web/apps/web/.next/server/pages/terminal/build-manifest.json +2 -2
  36. package/web/apps/web/.next/server/pages/terminal/client-build-manifest.json +1 -1
  37. package/web/apps/web/.next/server/pages/terminal.html +1 -1
  38. package/web/apps/web/server.js +1 -1
  39. package/web/node_modules/.bun/@img+colour@1.0.0/node_modules/@img/colour/color.cjs +0 -1594
  40. package/web/node_modules/.bun/@img+colour@1.0.0/node_modules/@img/colour/index.cjs +0 -1
  41. package/web/node_modules/.bun/@img+colour@1.0.0/node_modules/@img/colour/package.json +0 -45
  42. package/web/node_modules/.bun/@img+sharp-darwin-arm64@0.34.5/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64.node +0 -0
  43. package/web/node_modules/.bun/@img+sharp-darwin-arm64@0.34.5/node_modules/@img/sharp-darwin-arm64/package.json +0 -40
  44. package/web/node_modules/.bun/@img+sharp-libvips-darwin-arm64@1.2.4/node_modules/@img/sharp-libvips-darwin-arm64/README.md +0 -46
  45. package/web/node_modules/.bun/@img+sharp-libvips-darwin-arm64@1.2.4/node_modules/@img/sharp-libvips-darwin-arm64/lib/glib-2.0/include/glibconfig.h +0 -220
  46. package/web/node_modules/.bun/@img+sharp-libvips-darwin-arm64@1.2.4/node_modules/@img/sharp-libvips-darwin-arm64/lib/index.js +0 -1
  47. package/web/node_modules/.bun/@img+sharp-libvips-darwin-arm64@1.2.4/node_modules/@img/sharp-libvips-darwin-arm64/lib/libvips-cpp.8.17.3.dylib +0 -0
  48. package/web/node_modules/.bun/@img+sharp-libvips-darwin-arm64@1.2.4/node_modules/@img/sharp-libvips-darwin-arm64/package.json +0 -36
  49. package/web/node_modules/.bun/@img+sharp-libvips-darwin-arm64@1.2.4/node_modules/@img/sharp-libvips-darwin-arm64/versions.json +0 -30
  50. package/web/node_modules/.bun/@swc+helpers@0.5.15/node_modules/@swc/helpers/cjs/_interop_require_default.cjs +0 -6
  51. package/web/node_modules/.bun/@swc+helpers@0.5.15/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs +0 -38
  52. package/web/node_modules/.bun/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +0 -6
  53. package/web/node_modules/.bun/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_class_apply_descriptor_get.js +0 -6
  54. package/web/node_modules/.bun/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_class_apply_descriptor_set.js +0 -13
  55. package/web/node_modules/.bun/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_class_extract_field_descriptor.js +0 -6
  56. package/web/node_modules/.bun/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_class_private_field_get.js +0 -8
  57. package/web/node_modules/.bun/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_class_private_field_init.js +0 -7
  58. package/web/node_modules/.bun/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_class_private_field_set.js +0 -9
  59. package/web/node_modules/.bun/@swc+helpers@0.5.15/node_modules/@swc/helpers/package.json +0 -471
  60. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/channel.js +0 -177
  61. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/colour.js +0 -195
  62. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/composite.js +0 -212
  63. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/constructor.js +0 -499
  64. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/index.js +0 -16
  65. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/input.js +0 -809
  66. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/is.js +0 -143
  67. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/libvips.js +0 -207
  68. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/operation.js +0 -1016
  69. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/output.js +0 -1666
  70. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/resize.js +0 -595
  71. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/sharp.js +0 -121
  72. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/utility.js +0 -291
  73. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/package.json +0 -202
  74. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/_tsc.js +0 -133818
  75. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/_tsserver.js +0 -659
  76. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/_typingsInstaller.js +0 -222
  77. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +0 -2122
  78. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/de/diagnosticMessages.generated.json +0 -2122
  79. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/es/diagnosticMessages.generated.json +0 -2122
  80. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +0 -2122
  81. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/it/diagnosticMessages.generated.json +0 -2122
  82. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +0 -2122
  83. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +0 -2122
  84. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +0 -2122
  85. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +0 -2122
  86. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +0 -2122
  87. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +0 -2122
  88. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/tsc.js +0 -8
  89. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/tsserver.js +0 -8
  90. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/tsserverlibrary.js +0 -21
  91. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/typesMap.json +0 -497
  92. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/typescript.js +0 -200276
  93. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/typingsInstaller.js +0 -8
  94. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/watchGuard.js +0 -53
  95. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -2122
  96. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -2122
  97. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/package.json +0 -120
  98. /package/web/.next/static/{b-zSCTvx5IzLyCj7s91p4 → A7pW-dtFIbPCSkvE8uenX}/_clientMiddlewareManifest.json +0 -0
  99. /package/web/.next/static/{b-zSCTvx5IzLyCj7s91p4 → A7pW-dtFIbPCSkvE8uenX}/_ssgManifest.js +0 -0
@@ -1,195 +0,0 @@
1
- /*!
2
- Copyright 2013 Lovell Fuller and others.
3
- SPDX-License-Identifier: Apache-2.0
4
- */
5
-
6
- const color = require('@img/colour');
7
- const is = require('./is');
8
-
9
- /**
10
- * Colourspaces.
11
- * @private
12
- */
13
- const colourspace = {
14
- multiband: 'multiband',
15
- 'b-w': 'b-w',
16
- bw: 'b-w',
17
- cmyk: 'cmyk',
18
- srgb: 'srgb'
19
- };
20
-
21
- /**
22
- * Tint the image using the provided colour.
23
- * An alpha channel may be present and will be unchanged by the operation.
24
- *
25
- * @example
26
- * const output = await sharp(input)
27
- * .tint({ r: 255, g: 240, b: 16 })
28
- * .toBuffer();
29
- *
30
- * @param {string|Object} tint - Parsed by the [color](https://www.npmjs.org/package/color) module.
31
- * @returns {Sharp}
32
- * @throws {Error} Invalid parameter
33
- */
34
- function tint (tint) {
35
- this._setBackgroundColourOption('tint', tint);
36
- return this;
37
- }
38
-
39
- /**
40
- * Convert to 8-bit greyscale; 256 shades of grey.
41
- * This is a linear operation. If the input image is in a non-linear colour space such as sRGB, use `gamma()` with `greyscale()` for the best results.
42
- * By default the output image will be web-friendly sRGB and contain three (identical) colour channels.
43
- * This may be overridden by other sharp operations such as `toColourspace('b-w')`,
44
- * which will produce an output image containing one colour channel.
45
- * An alpha channel may be present, and will be unchanged by the operation.
46
- *
47
- * @example
48
- * const output = await sharp(input).greyscale().toBuffer();
49
- *
50
- * @param {Boolean} [greyscale=true]
51
- * @returns {Sharp}
52
- */
53
- function greyscale (greyscale) {
54
- this.options.greyscale = is.bool(greyscale) ? greyscale : true;
55
- return this;
56
- }
57
-
58
- /**
59
- * Alternative spelling of `greyscale`.
60
- * @param {Boolean} [grayscale=true]
61
- * @returns {Sharp}
62
- */
63
- function grayscale (grayscale) {
64
- return this.greyscale(grayscale);
65
- }
66
-
67
- /**
68
- * Set the pipeline colourspace.
69
- *
70
- * The input image will be converted to the provided colourspace at the start of the pipeline.
71
- * All operations will use this colourspace before converting to the output colourspace,
72
- * as defined by {@link #tocolourspace toColourspace}.
73
- *
74
- * @since 0.29.0
75
- *
76
- * @example
77
- * // Run pipeline in 16 bits per channel RGB while converting final result to 8 bits per channel sRGB.
78
- * await sharp(input)
79
- * .pipelineColourspace('rgb16')
80
- * .toColourspace('srgb')
81
- * .toFile('16bpc-pipeline-to-8bpc-output.png')
82
- *
83
- * @param {string} [colourspace] - pipeline colourspace e.g. `rgb16`, `scrgb`, `lab`, `grey16` [...](https://www.libvips.org/API/current/enum.Interpretation.html)
84
- * @returns {Sharp}
85
- * @throws {Error} Invalid parameters
86
- */
87
- function pipelineColourspace (colourspace) {
88
- if (!is.string(colourspace)) {
89
- throw is.invalidParameterError('colourspace', 'string', colourspace);
90
- }
91
- this.options.colourspacePipeline = colourspace;
92
- return this;
93
- }
94
-
95
- /**
96
- * Alternative spelling of `pipelineColourspace`.
97
- * @param {string} [colorspace] - pipeline colorspace.
98
- * @returns {Sharp}
99
- * @throws {Error} Invalid parameters
100
- */
101
- function pipelineColorspace (colorspace) {
102
- return this.pipelineColourspace(colorspace);
103
- }
104
-
105
- /**
106
- * Set the output colourspace.
107
- * By default output image will be web-friendly sRGB, with additional channels interpreted as alpha channels.
108
- *
109
- * @example
110
- * // Output 16 bits per pixel RGB
111
- * await sharp(input)
112
- * .toColourspace('rgb16')
113
- * .toFile('16-bpp.png')
114
- *
115
- * @param {string} [colourspace] - output colourspace e.g. `srgb`, `rgb`, `cmyk`, `lab`, `b-w` [...](https://www.libvips.org/API/current/enum.Interpretation.html)
116
- * @returns {Sharp}
117
- * @throws {Error} Invalid parameters
118
- */
119
- function toColourspace (colourspace) {
120
- if (!is.string(colourspace)) {
121
- throw is.invalidParameterError('colourspace', 'string', colourspace);
122
- }
123
- this.options.colourspace = colourspace;
124
- return this;
125
- }
126
-
127
- /**
128
- * Alternative spelling of `toColourspace`.
129
- * @param {string} [colorspace] - output colorspace.
130
- * @returns {Sharp}
131
- * @throws {Error} Invalid parameters
132
- */
133
- function toColorspace (colorspace) {
134
- return this.toColourspace(colorspace);
135
- }
136
-
137
- /**
138
- * Create a RGBA colour array from a given value.
139
- * @private
140
- * @param {string|Object} value
141
- * @throws {Error} Invalid value
142
- */
143
- function _getBackgroundColourOption (value) {
144
- if (
145
- is.object(value) ||
146
- (is.string(value) && value.length >= 3 && value.length <= 200)
147
- ) {
148
- const colour = color(value);
149
- return [
150
- colour.red(),
151
- colour.green(),
152
- colour.blue(),
153
- Math.round(colour.alpha() * 255)
154
- ];
155
- } else {
156
- throw is.invalidParameterError('background', 'object or string', value);
157
- }
158
- }
159
-
160
- /**
161
- * Update a colour attribute of the this.options Object.
162
- * @private
163
- * @param {string} key
164
- * @param {string|Object} value
165
- * @throws {Error} Invalid value
166
- */
167
- function _setBackgroundColourOption (key, value) {
168
- if (is.defined(value)) {
169
- this.options[key] = _getBackgroundColourOption(value);
170
- }
171
- }
172
-
173
- /**
174
- * Decorate the Sharp prototype with colour-related functions.
175
- * @module Sharp
176
- * @private
177
- */
178
- module.exports = (Sharp) => {
179
- Object.assign(Sharp.prototype, {
180
- // Public
181
- tint,
182
- greyscale,
183
- grayscale,
184
- pipelineColourspace,
185
- pipelineColorspace,
186
- toColourspace,
187
- toColorspace,
188
- // Private
189
- _getBackgroundColourOption,
190
- _setBackgroundColourOption
191
- });
192
- // Class attributes
193
- Sharp.colourspace = colourspace;
194
- Sharp.colorspace = colourspace;
195
- };
@@ -1,212 +0,0 @@
1
- /*!
2
- Copyright 2013 Lovell Fuller and others.
3
- SPDX-License-Identifier: Apache-2.0
4
- */
5
-
6
- const is = require('./is');
7
-
8
- /**
9
- * Blend modes.
10
- * @member
11
- * @private
12
- */
13
- const blend = {
14
- clear: 'clear',
15
- source: 'source',
16
- over: 'over',
17
- in: 'in',
18
- out: 'out',
19
- atop: 'atop',
20
- dest: 'dest',
21
- 'dest-over': 'dest-over',
22
- 'dest-in': 'dest-in',
23
- 'dest-out': 'dest-out',
24
- 'dest-atop': 'dest-atop',
25
- xor: 'xor',
26
- add: 'add',
27
- saturate: 'saturate',
28
- multiply: 'multiply',
29
- screen: 'screen',
30
- overlay: 'overlay',
31
- darken: 'darken',
32
- lighten: 'lighten',
33
- 'colour-dodge': 'colour-dodge',
34
- 'color-dodge': 'colour-dodge',
35
- 'colour-burn': 'colour-burn',
36
- 'color-burn': 'colour-burn',
37
- 'hard-light': 'hard-light',
38
- 'soft-light': 'soft-light',
39
- difference: 'difference',
40
- exclusion: 'exclusion'
41
- };
42
-
43
- /**
44
- * Composite image(s) over the processed (resized, extracted etc.) image.
45
- *
46
- * The images to composite must be the same size or smaller than the processed image.
47
- * If both `top` and `left` options are provided, they take precedence over `gravity`.
48
- *
49
- * Other operations in the same processing pipeline (e.g. resize, rotate, flip,
50
- * flop, extract) will always be applied to the input image before composition.
51
- *
52
- * The `blend` option can be one of `clear`, `source`, `over`, `in`, `out`, `atop`,
53
- * `dest`, `dest-over`, `dest-in`, `dest-out`, `dest-atop`,
54
- * `xor`, `add`, `saturate`, `multiply`, `screen`, `overlay`, `darken`, `lighten`,
55
- * `colour-dodge`, `color-dodge`, `colour-burn`,`color-burn`,
56
- * `hard-light`, `soft-light`, `difference`, `exclusion`.
57
- *
58
- * More information about blend modes can be found at
59
- * https://www.libvips.org/API/current/enum.BlendMode.html
60
- * and https://www.cairographics.org/operators/
61
- *
62
- * @since 0.22.0
63
- *
64
- * @example
65
- * await sharp(background)
66
- * .composite([
67
- * { input: layer1, gravity: 'northwest' },
68
- * { input: layer2, gravity: 'southeast' },
69
- * ])
70
- * .toFile('combined.png');
71
- *
72
- * @example
73
- * const output = await sharp('input.gif', { animated: true })
74
- * .composite([
75
- * { input: 'overlay.png', tile: true, blend: 'saturate' }
76
- * ])
77
- * .toBuffer();
78
- *
79
- * @example
80
- * sharp('input.png')
81
- * .rotate(180)
82
- * .resize(300)
83
- * .flatten( { background: '#ff6600' } )
84
- * .composite([{ input: 'overlay.png', gravity: 'southeast' }])
85
- * .sharpen()
86
- * .withMetadata()
87
- * .webp( { quality: 90 } )
88
- * .toBuffer()
89
- * .then(function(outputBuffer) {
90
- * // outputBuffer contains upside down, 300px wide, alpha channel flattened
91
- * // onto orange background, composited with overlay.png with SE gravity,
92
- * // sharpened, with metadata, 90% quality WebP image data. Phew!
93
- * });
94
- *
95
- * @param {Object[]} images - Ordered list of images to composite
96
- * @param {Buffer|String} [images[].input] - Buffer containing image data, String containing the path to an image file, or Create object (see below)
97
- * @param {Object} [images[].input.create] - describes a blank overlay to be created.
98
- * @param {Number} [images[].input.create.width]
99
- * @param {Number} [images[].input.create.height]
100
- * @param {Number} [images[].input.create.channels] - 3-4
101
- * @param {String|Object} [images[].input.create.background] - parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha.
102
- * @param {Object} [images[].input.text] - describes a new text image to be created.
103
- * @param {string} [images[].input.text.text] - text to render as a UTF-8 string. It can contain Pango markup, for example `<i>Le</i>Monde`.
104
- * @param {string} [images[].input.text.font] - font name to render with.
105
- * @param {string} [images[].input.text.fontfile] - absolute filesystem path to a font file that can be used by `font`.
106
- * @param {number} [images[].input.text.width=0] - integral number of pixels to word-wrap at. Lines of text wider than this will be broken at word boundaries.
107
- * @param {number} [images[].input.text.height=0] - integral number of pixels high. When defined, `dpi` will be ignored and the text will automatically fit the pixel resolution defined by `width` and `height`. Will be ignored if `width` is not specified or set to 0.
108
- * @param {string} [images[].input.text.align='left'] - text alignment (`'left'`, `'centre'`, `'center'`, `'right'`).
109
- * @param {boolean} [images[].input.text.justify=false] - set this to true to apply justification to the text.
110
- * @param {number} [images[].input.text.dpi=72] - the resolution (size) at which to render the text. Does not take effect if `height` is specified.
111
- * @param {boolean} [images[].input.text.rgba=false] - set this to true to enable RGBA output. This is useful for colour emoji rendering, or support for Pango markup features like `<span foreground="red">Red!</span>`.
112
- * @param {number} [images[].input.text.spacing=0] - text line height in points. Will use the font line height if none is specified.
113
- * @param {Boolean} [images[].autoOrient=false] - set to true to use EXIF orientation data, if present, to orient the image.
114
- * @param {String} [images[].blend='over'] - how to blend this image with the image below.
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.
118
- * @param {Boolean} [images[].tile=false] - set to true to repeat the overlay image across the entire image with the given `gravity`.
119
- * @param {Boolean} [images[].premultiplied=false] - set to true to avoid premultiplying the image below. Equivalent to the `--premultiplied` vips option.
120
- * @param {Number} [images[].density=72] - number representing the DPI for vector overlay image.
121
- * @param {Object} [images[].raw] - describes overlay when using raw pixel data.
122
- * @param {Number} [images[].raw.width]
123
- * @param {Number} [images[].raw.height]
124
- * @param {Number} [images[].raw.channels]
125
- * @param {boolean} [images[].animated=false] - Set to `true` to read all frames/pages of an animated image.
126
- * @param {string} [images[].failOn='warning'] - @see {@link /api-constructor/ constructor parameters}
127
- * @param {number|boolean} [images[].limitInputPixels=268402689] - @see {@link /api-constructor/ constructor parameters}
128
- * @returns {Sharp}
129
- * @throws {Error} Invalid parameters
130
- */
131
- function composite (images) {
132
- if (!Array.isArray(images)) {
133
- throw is.invalidParameterError('images to composite', 'array', images);
134
- }
135
- this.options.composite = images.map(image => {
136
- if (!is.object(image)) {
137
- throw is.invalidParameterError('image to composite', 'object', image);
138
- }
139
- const inputOptions = this._inputOptionsFromObject(image);
140
- const composite = {
141
- input: this._createInputDescriptor(image.input, inputOptions, { allowStream: false }),
142
- blend: 'over',
143
- tile: false,
144
- left: 0,
145
- top: 0,
146
- hasOffset: false,
147
- gravity: 0,
148
- premultiplied: false
149
- };
150
- if (is.defined(image.blend)) {
151
- if (is.string(blend[image.blend])) {
152
- composite.blend = blend[image.blend];
153
- } else {
154
- throw is.invalidParameterError('blend', 'valid blend name', image.blend);
155
- }
156
- }
157
- if (is.defined(image.tile)) {
158
- if (is.bool(image.tile)) {
159
- composite.tile = image.tile;
160
- } else {
161
- throw is.invalidParameterError('tile', 'boolean', image.tile);
162
- }
163
- }
164
- if (is.defined(image.left)) {
165
- if (is.integer(image.left)) {
166
- composite.left = image.left;
167
- } else {
168
- throw is.invalidParameterError('left', 'integer', image.left);
169
- }
170
- }
171
- if (is.defined(image.top)) {
172
- if (is.integer(image.top)) {
173
- composite.top = image.top;
174
- } else {
175
- throw is.invalidParameterError('top', 'integer', image.top);
176
- }
177
- }
178
- if (is.defined(image.top) !== is.defined(image.left)) {
179
- throw new Error('Expected both left and top to be set');
180
- } else {
181
- composite.hasOffset = is.integer(image.top) && is.integer(image.left);
182
- }
183
- if (is.defined(image.gravity)) {
184
- if (is.integer(image.gravity) && is.inRange(image.gravity, 0, 8)) {
185
- composite.gravity = image.gravity;
186
- } else if (is.string(image.gravity) && is.integer(this.constructor.gravity[image.gravity])) {
187
- composite.gravity = this.constructor.gravity[image.gravity];
188
- } else {
189
- throw is.invalidParameterError('gravity', 'valid gravity', image.gravity);
190
- }
191
- }
192
- if (is.defined(image.premultiplied)) {
193
- if (is.bool(image.premultiplied)) {
194
- composite.premultiplied = image.premultiplied;
195
- } else {
196
- throw is.invalidParameterError('premultiplied', 'boolean', image.premultiplied);
197
- }
198
- }
199
- return composite;
200
- });
201
- return this;
202
- }
203
-
204
- /**
205
- * Decorate the Sharp prototype with composite-related functions.
206
- * @module Sharp
207
- * @private
208
- */
209
- module.exports = (Sharp) => {
210
- Sharp.prototype.composite = composite;
211
- Sharp.blend = blend;
212
- };