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,499 +0,0 @@
1
- /*!
2
- Copyright 2013 Lovell Fuller and others.
3
- SPDX-License-Identifier: Apache-2.0
4
- */
5
-
6
- const util = require('node:util');
7
- const stream = require('node:stream');
8
- const is = require('./is');
9
-
10
- require('./sharp');
11
-
12
- // Use NODE_DEBUG=sharp to enable libvips warnings
13
- const debuglog = util.debuglog('sharp');
14
-
15
- const queueListener = (queueLength) => {
16
- Sharp.queue.emit('change', queueLength);
17
- };
18
-
19
- /**
20
- * Constructor factory to create an instance of `sharp`, to which further methods are chained.
21
- *
22
- * JPEG, PNG, WebP, GIF, AVIF or TIFF format image data can be streamed out from this object.
23
- * When using Stream based output, derived attributes are available from the `info` event.
24
- *
25
- * Non-critical problems encountered during processing are emitted as `warning` events.
26
- *
27
- * Implements the [stream.Duplex](http://nodejs.org/api/stream.html#stream_class_stream_duplex) class.
28
- *
29
- * When loading more than one page/frame of an animated image,
30
- * these are combined as a vertically-stacked "toilet roll" image
31
- * where the overall height is the `pageHeight` multiplied by the number of `pages`.
32
- *
33
- * @constructs Sharp
34
- *
35
- * @emits Sharp#info
36
- * @emits Sharp#warning
37
- *
38
- * @example
39
- * sharp('input.jpg')
40
- * .resize(300, 200)
41
- * .toFile('output.jpg', function(err) {
42
- * // output.jpg is a 300 pixels wide and 200 pixels high image
43
- * // containing a scaled and cropped version of input.jpg
44
- * });
45
- *
46
- * @example
47
- * // Read image data from remote URL,
48
- * // resize to 300 pixels wide,
49
- * // emit an 'info' event with calculated dimensions
50
- * // and finally write image data to writableStream
51
- * const { body } = fetch('https://...');
52
- * const readableStream = Readable.fromWeb(body);
53
- * const transformer = sharp()
54
- * .resize(300)
55
- * .on('info', ({ height }) => {
56
- * console.log(`Image height is ${height}`);
57
- * });
58
- * readableStream.pipe(transformer).pipe(writableStream);
59
- *
60
- * @example
61
- * // Create a blank 300x200 PNG image of semi-translucent red pixels
62
- * sharp({
63
- * create: {
64
- * width: 300,
65
- * height: 200,
66
- * channels: 4,
67
- * background: { r: 255, g: 0, b: 0, alpha: 0.5 }
68
- * }
69
- * })
70
- * .png()
71
- * .toBuffer()
72
- * .then( ... );
73
- *
74
- * @example
75
- * // Convert an animated GIF to an animated WebP
76
- * await sharp('in.gif', { animated: true }).toFile('out.webp');
77
- *
78
- * @example
79
- * // Read a raw array of pixels and save it to a png
80
- * const input = Uint8Array.from([255, 255, 255, 0, 0, 0]); // or Uint8ClampedArray
81
- * const image = sharp(input, {
82
- * // because the input does not contain its dimensions or how many channels it has
83
- * // we need to specify it in the constructor options
84
- * raw: {
85
- * width: 2,
86
- * height: 1,
87
- * channels: 3
88
- * }
89
- * });
90
- * await image.toFile('my-two-pixels.png');
91
- *
92
- * @example
93
- * // Generate RGB Gaussian noise
94
- * await sharp({
95
- * create: {
96
- * width: 300,
97
- * height: 200,
98
- * channels: 3,
99
- * noise: {
100
- * type: 'gaussian',
101
- * mean: 128,
102
- * sigma: 30
103
- * }
104
- * }
105
- * }).toFile('noise.png');
106
- *
107
- * @example
108
- * // Generate an image from text
109
- * await sharp({
110
- * text: {
111
- * text: 'Hello, world!',
112
- * width: 400, // max width
113
- * height: 300 // max height
114
- * }
115
- * }).toFile('text_bw.png');
116
- *
117
- * @example
118
- * // Generate an rgba image from text using pango markup and font
119
- * await sharp({
120
- * text: {
121
- * text: '<span foreground="red">Red!</span><span background="cyan">blue</span>',
122
- * font: 'sans',
123
- * rgba: true,
124
- * dpi: 300
125
- * }
126
- * }).toFile('text_rgba.png');
127
- *
128
- * @example
129
- * // Join four input images as a 2x2 grid with a 4 pixel gutter
130
- * const data = await sharp(
131
- * [image1, image2, image3, image4],
132
- * { join: { across: 2, shim: 4 } }
133
- * ).toBuffer();
134
- *
135
- * @example
136
- * // Generate a two-frame animated image from emoji
137
- * const images = ['😀', '😛'].map(text => ({
138
- * text: { text, width: 64, height: 64, channels: 4, rgba: true }
139
- * }));
140
- * await sharp(images, { join: { animated: true } }).toFile('out.gif');
141
- *
142
- * @param {(Buffer|ArrayBuffer|Uint8Array|Uint8ClampedArray|Int8Array|Uint16Array|Int16Array|Uint32Array|Int32Array|Float32Array|Float64Array|string|Array)} [input] - if present, can be
143
- * a Buffer / ArrayBuffer / Uint8Array / Uint8ClampedArray containing JPEG, PNG, WebP, AVIF, GIF, SVG or TIFF image data, or
144
- * a TypedArray containing raw pixel image data, or
145
- * a String containing the filesystem path to an JPEG, PNG, WebP, AVIF, GIF, SVG or TIFF image file.
146
- * An array of inputs can be provided, and these will be joined together.
147
- * JPEG, PNG, WebP, AVIF, GIF, SVG, TIFF or raw pixel image data can be streamed into the object when not present.
148
- * @param {Object} [options] - if present, is an Object with optional attributes.
149
- * @param {string} [options.failOn='warning'] - When to abort processing of invalid pixel data, one of (in order of sensitivity, least to most): 'none', 'truncated', 'error', 'warning'. Higher levels imply lower levels. Invalid metadata will always abort.
150
- * @param {number|boolean} [options.limitInputPixels=268402689] - Do not process input images where the number of pixels
151
- * (width x height) exceeds this limit. Assumes image dimensions contained in the input metadata can be trusted.
152
- * An integral Number of pixels, zero or false to remove limit, true to use default limit of 268402689 (0x3FFF x 0x3FFF).
153
- * @param {boolean} [options.unlimited=false] - Set this to `true` to remove safety features that help prevent memory exhaustion (JPEG, PNG, SVG, HEIF).
154
- * @param {boolean} [options.autoOrient=false] - Set this to `true` to rotate/flip the image to match EXIF `Orientation`, if any.
155
- * @param {boolean} [options.sequentialRead=true] - Set this to `false` to use random access rather than sequential read. Some operations will do this automatically.
156
- * @param {number} [options.density=72] - number representing the DPI for vector images in the range 1 to 100000.
157
- * @param {number} [options.ignoreIcc=false] - should the embedded ICC profile, if any, be ignored.
158
- * @param {number} [options.pages=1] - Number of pages to extract for multi-page input (GIF, WebP, TIFF), use -1 for all pages.
159
- * @param {number} [options.page=0] - Page number to start extracting from for multi-page input (GIF, WebP, TIFF), zero based.
160
- * @param {boolean} [options.animated=false] - Set to `true` to read all frames/pages of an animated image (GIF, WebP, TIFF), equivalent of setting `pages` to `-1`.
161
- * @param {Object} [options.raw] - describes raw pixel input image data. See `raw()` for pixel ordering.
162
- * @param {number} [options.raw.width] - integral number of pixels wide.
163
- * @param {number} [options.raw.height] - integral number of pixels high.
164
- * @param {number} [options.raw.channels] - integral number of channels, between 1 and 4.
165
- * @param {boolean} [options.raw.premultiplied] - specifies that the raw input has already been premultiplied, set to `true`
166
- * to avoid sharp premultiplying the image. (optional, default `false`)
167
- * @param {number} [options.raw.pageHeight] - The pixel height of each page/frame for animated images, must be an integral factor of `raw.height`.
168
- * @param {Object} [options.create] - describes a new image to be created.
169
- * @param {number} [options.create.width] - integral number of pixels wide.
170
- * @param {number} [options.create.height] - integral number of pixels high.
171
- * @param {number} [options.create.channels] - integral number of channels, either 3 (RGB) or 4 (RGBA).
172
- * @param {string|Object} [options.create.background] - parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha.
173
- * @param {number} [options.create.pageHeight] - The pixel height of each page/frame for animated images, must be an integral factor of `create.height`.
174
- * @param {Object} [options.create.noise] - describes a noise to be created.
175
- * @param {string} [options.create.noise.type] - type of generated noise, currently only `gaussian` is supported.
176
- * @param {number} [options.create.noise.mean=128] - Mean value of pixels in the generated noise.
177
- * @param {number} [options.create.noise.sigma=30] - Standard deviation of pixel values in the generated noise.
178
- * @param {Object} [options.text] - describes a new text image to be created.
179
- * @param {string} [options.text.text] - text to render as a UTF-8 string. It can contain Pango markup, for example `<i>Le</i>Monde`.
180
- * @param {string} [options.text.font] - font name to render with.
181
- * @param {string} [options.text.fontfile] - absolute filesystem path to a font file that can be used by `font`.
182
- * @param {number} [options.text.width=0] - Integral number of pixels to word-wrap at. Lines of text wider than this will be broken at word boundaries.
183
- * @param {number} [options.text.height=0] - Maximum 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.
184
- * @param {string} [options.text.align='left'] - Alignment style for multi-line text (`'left'`, `'centre'`, `'center'`, `'right'`).
185
- * @param {boolean} [options.text.justify=false] - set this to true to apply justification to the text.
186
- * @param {number} [options.text.dpi=72] - the resolution (size) at which to render the text. Does not take effect if `height` is specified.
187
- * @param {boolean} [options.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>`.
188
- * @param {number} [options.text.spacing=0] - text line height in points. Will use the font line height if none is specified.
189
- * @param {string} [options.text.wrap='word'] - word wrapping style when width is provided, one of: 'word', 'char', 'word-char' (prefer word, fallback to char) or 'none'.
190
- * @param {Object} [options.join] - describes how an array of input images should be joined.
191
- * @param {number} [options.join.across=1] - number of images to join horizontally.
192
- * @param {boolean} [options.join.animated=false] - set this to `true` to join the images as an animated image.
193
- * @param {number} [options.join.shim=0] - number of pixels to insert between joined images.
194
- * @param {string|Object} [options.join.background] - parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha.
195
- * @param {string} [options.join.halign='left'] - horizontal alignment style for images joined horizontally (`'left'`, `'centre'`, `'center'`, `'right'`).
196
- * @param {string} [options.join.valign='top'] - vertical alignment style for images joined vertically (`'top'`, `'centre'`, `'center'`, `'bottom'`).
197
- * @param {Object} [options.tiff] - Describes TIFF specific options.
198
- * @param {number} [options.tiff.subifd=-1] - Sub Image File Directory to extract for OME-TIFF, defaults to main image.
199
- * @param {Object} [options.svg] - Describes SVG specific options.
200
- * @param {string} [options.svg.stylesheet] - Custom CSS for SVG input, applied with a User Origin during the CSS cascade.
201
- * @param {boolean} [options.svg.highBitdepth=false] - Set to `true` to render SVG input at 32-bits per channel (128-bit) instead of 8-bits per channel (32-bit) RGBA.
202
- * @param {Object} [options.pdf] - Describes PDF specific options. Requires the use of a globally-installed libvips compiled with support for PDFium, Poppler, ImageMagick or GraphicsMagick.
203
- * @param {string|Object} [options.pdf.background] - Background colour to use when PDF is partially transparent. Parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha.
204
- * @param {Object} [options.openSlide] - Describes OpenSlide specific options. Requires the use of a globally-installed libvips compiled with support for OpenSlide.
205
- * @param {number} [options.openSlide.level=0] - Level to extract from a multi-level input, zero based.
206
- * @param {Object} [options.jp2] - Describes JPEG 2000 specific options. Requires the use of a globally-installed libvips compiled with support for OpenJPEG.
207
- * @param {boolean} [options.jp2.oneshot=false] - Set to `true` to decode tiled JPEG 2000 images in a single operation, improving compatibility.
208
- * @returns {Sharp}
209
- * @throws {Error} Invalid parameters
210
- */
211
- const Sharp = function (input, options) {
212
- // biome-ignore lint/complexity/noArguments: constructor factory
213
- if (arguments.length === 1 && !is.defined(input)) {
214
- throw new Error('Invalid input');
215
- }
216
- if (!(this instanceof Sharp)) {
217
- return new Sharp(input, options);
218
- }
219
- stream.Duplex.call(this);
220
- this.options = {
221
- // resize options
222
- topOffsetPre: -1,
223
- leftOffsetPre: -1,
224
- widthPre: -1,
225
- heightPre: -1,
226
- topOffsetPost: -1,
227
- leftOffsetPost: -1,
228
- widthPost: -1,
229
- heightPost: -1,
230
- width: -1,
231
- height: -1,
232
- canvas: 'crop',
233
- position: 0,
234
- resizeBackground: [0, 0, 0, 255],
235
- angle: 0,
236
- rotationAngle: 0,
237
- rotationBackground: [0, 0, 0, 255],
238
- rotateBefore: false,
239
- orientBefore: false,
240
- flip: false,
241
- flop: false,
242
- extendTop: 0,
243
- extendBottom: 0,
244
- extendLeft: 0,
245
- extendRight: 0,
246
- extendBackground: [0, 0, 0, 255],
247
- extendWith: 'background',
248
- withoutEnlargement: false,
249
- withoutReduction: false,
250
- affineMatrix: [],
251
- affineBackground: [0, 0, 0, 255],
252
- affineIdx: 0,
253
- affineIdy: 0,
254
- affineOdx: 0,
255
- affineOdy: 0,
256
- affineInterpolator: this.constructor.interpolators.bilinear,
257
- kernel: 'lanczos3',
258
- fastShrinkOnLoad: true,
259
- // operations
260
- tint: [-1, 0, 0, 0],
261
- flatten: false,
262
- flattenBackground: [0, 0, 0],
263
- unflatten: false,
264
- negate: false,
265
- negateAlpha: true,
266
- medianSize: 0,
267
- blurSigma: 0,
268
- precision: 'integer',
269
- minAmpl: 0.2,
270
- sharpenSigma: 0,
271
- sharpenM1: 1,
272
- sharpenM2: 2,
273
- sharpenX1: 2,
274
- sharpenY2: 10,
275
- sharpenY3: 20,
276
- threshold: 0,
277
- thresholdGrayscale: true,
278
- trimBackground: [],
279
- trimThreshold: -1,
280
- trimLineArt: false,
281
- dilateWidth: 0,
282
- erodeWidth: 0,
283
- gamma: 0,
284
- gammaOut: 0,
285
- greyscale: false,
286
- normalise: false,
287
- normaliseLower: 1,
288
- normaliseUpper: 99,
289
- claheWidth: 0,
290
- claheHeight: 0,
291
- claheMaxSlope: 3,
292
- brightness: 1,
293
- saturation: 1,
294
- hue: 0,
295
- lightness: 0,
296
- booleanBufferIn: null,
297
- booleanFileIn: '',
298
- joinChannelIn: [],
299
- extractChannel: -1,
300
- removeAlpha: false,
301
- ensureAlpha: -1,
302
- colourspace: 'srgb',
303
- colourspacePipeline: 'last',
304
- composite: [],
305
- // output
306
- fileOut: '',
307
- formatOut: 'input',
308
- streamOut: false,
309
- keepMetadata: 0,
310
- withMetadataOrientation: -1,
311
- withMetadataDensity: 0,
312
- withIccProfile: '',
313
- withExif: {},
314
- withExifMerge: true,
315
- withXmp: '',
316
- resolveWithObject: false,
317
- loop: -1,
318
- delay: [],
319
- // output format
320
- jpegQuality: 80,
321
- jpegProgressive: false,
322
- jpegChromaSubsampling: '4:2:0',
323
- jpegTrellisQuantisation: false,
324
- jpegOvershootDeringing: false,
325
- jpegOptimiseScans: false,
326
- jpegOptimiseCoding: true,
327
- jpegQuantisationTable: 0,
328
- pngProgressive: false,
329
- pngCompressionLevel: 6,
330
- pngAdaptiveFiltering: false,
331
- pngPalette: false,
332
- pngQuality: 100,
333
- pngEffort: 7,
334
- pngBitdepth: 8,
335
- pngDither: 1,
336
- jp2Quality: 80,
337
- jp2TileHeight: 512,
338
- jp2TileWidth: 512,
339
- jp2Lossless: false,
340
- jp2ChromaSubsampling: '4:4:4',
341
- webpQuality: 80,
342
- webpAlphaQuality: 100,
343
- webpLossless: false,
344
- webpNearLossless: false,
345
- webpSmartSubsample: false,
346
- webpSmartDeblock: false,
347
- webpPreset: 'default',
348
- webpEffort: 4,
349
- webpMinSize: false,
350
- webpMixed: false,
351
- gifBitdepth: 8,
352
- gifEffort: 7,
353
- gifDither: 1,
354
- gifInterFrameMaxError: 0,
355
- gifInterPaletteMaxError: 3,
356
- gifKeepDuplicateFrames: false,
357
- gifReuse: true,
358
- gifProgressive: false,
359
- tiffQuality: 80,
360
- tiffCompression: 'jpeg',
361
- tiffBigtiff: false,
362
- tiffPredictor: 'horizontal',
363
- tiffPyramid: false,
364
- tiffMiniswhite: false,
365
- tiffBitdepth: 8,
366
- tiffTile: false,
367
- tiffTileHeight: 256,
368
- tiffTileWidth: 256,
369
- tiffXres: 1.0,
370
- tiffYres: 1.0,
371
- tiffResolutionUnit: 'inch',
372
- heifQuality: 50,
373
- heifLossless: false,
374
- heifCompression: 'av1',
375
- heifEffort: 4,
376
- heifChromaSubsampling: '4:4:4',
377
- heifBitdepth: 8,
378
- jxlDistance: 1,
379
- jxlDecodingTier: 0,
380
- jxlEffort: 7,
381
- jxlLossless: false,
382
- rawDepth: 'uchar',
383
- tileSize: 256,
384
- tileOverlap: 0,
385
- tileContainer: 'fs',
386
- tileLayout: 'dz',
387
- tileFormat: 'last',
388
- tileDepth: 'last',
389
- tileAngle: 0,
390
- tileSkipBlanks: -1,
391
- tileBackground: [255, 255, 255, 255],
392
- tileCentre: false,
393
- tileId: 'https://example.com/iiif',
394
- tileBasename: '',
395
- timeoutSeconds: 0,
396
- linearA: [],
397
- linearB: [],
398
- pdfBackground: [255, 255, 255, 255],
399
- // Function to notify of libvips warnings
400
- debuglog: warning => {
401
- this.emit('warning', warning);
402
- debuglog(warning);
403
- },
404
- // Function to notify of queue length changes
405
- queueListener
406
- };
407
- this.options.input = this._createInputDescriptor(input, options, { allowStream: true });
408
- return this;
409
- };
410
- Object.setPrototypeOf(Sharp.prototype, stream.Duplex.prototype);
411
- Object.setPrototypeOf(Sharp, stream.Duplex);
412
-
413
- /**
414
- * Take a "snapshot" of the Sharp instance, returning a new instance.
415
- * Cloned instances inherit the input of their parent instance.
416
- * This allows multiple output Streams and therefore multiple processing pipelines to share a single input Stream.
417
- *
418
- * @example
419
- * const pipeline = sharp().rotate();
420
- * pipeline.clone().resize(800, 600).pipe(firstWritableStream);
421
- * pipeline.clone().extract({ left: 20, top: 20, width: 100, height: 100 }).pipe(secondWritableStream);
422
- * readableStream.pipe(pipeline);
423
- * // firstWritableStream receives auto-rotated, resized readableStream
424
- * // secondWritableStream receives auto-rotated, extracted region of readableStream
425
- *
426
- * @example
427
- * // Create a pipeline that will download an image, resize it and format it to different files
428
- * // Using Promises to know when the pipeline is complete
429
- * const fs = require("fs");
430
- * const got = require("got");
431
- * const sharpStream = sharp({ failOn: 'none' });
432
- *
433
- * const promises = [];
434
- *
435
- * promises.push(
436
- * sharpStream
437
- * .clone()
438
- * .jpeg({ quality: 100 })
439
- * .toFile("originalFile.jpg")
440
- * );
441
- *
442
- * promises.push(
443
- * sharpStream
444
- * .clone()
445
- * .resize({ width: 500 })
446
- * .jpeg({ quality: 80 })
447
- * .toFile("optimized-500.jpg")
448
- * );
449
- *
450
- * promises.push(
451
- * sharpStream
452
- * .clone()
453
- * .resize({ width: 500 })
454
- * .webp({ quality: 80 })
455
- * .toFile("optimized-500.webp")
456
- * );
457
- *
458
- * // https://github.com/sindresorhus/got/blob/main/documentation/3-streams.md
459
- * got.stream("https://www.example.com/some-file.jpg").pipe(sharpStream);
460
- *
461
- * Promise.all(promises)
462
- * .then(res => { console.log("Done!", res); })
463
- * .catch(err => {
464
- * console.error("Error processing files, let's clean it up", err);
465
- * try {
466
- * fs.unlinkSync("originalFile.jpg");
467
- * fs.unlinkSync("optimized-500.jpg");
468
- * fs.unlinkSync("optimized-500.webp");
469
- * } catch (e) {}
470
- * });
471
- *
472
- * @returns {Sharp}
473
- */
474
- function clone () {
475
- // Clone existing options
476
- const clone = this.constructor.call();
477
- const { debuglog, queueListener, ...options } = this.options;
478
- clone.options = structuredClone(options);
479
- clone.options.debuglog = debuglog;
480
- clone.options.queueListener = queueListener;
481
- // Pass 'finish' event to clone for Stream-based input
482
- if (this._isStreamInput()) {
483
- this.on('finish', () => {
484
- // Clone inherits input data
485
- this._flattenBufferIn();
486
- clone.options.input.buffer = this.options.input.buffer;
487
- clone.emit('finish');
488
- });
489
- }
490
- return clone;
491
- }
492
- Object.assign(Sharp.prototype, { clone });
493
-
494
- /**
495
- * Export constructor.
496
- * @module Sharp
497
- * @private
498
- */
499
- module.exports = Sharp;
@@ -1,16 +0,0 @@
1
- /*!
2
- Copyright 2013 Lovell Fuller and others.
3
- SPDX-License-Identifier: Apache-2.0
4
- */
5
-
6
- const Sharp = require('./constructor');
7
- require('./input')(Sharp);
8
- require('./resize')(Sharp);
9
- require('./composite')(Sharp);
10
- require('./operation')(Sharp);
11
- require('./colour')(Sharp);
12
- require('./channel')(Sharp);
13
- require('./output')(Sharp);
14
- require('./utility')(Sharp);
15
-
16
- module.exports = Sharp;