@revizly/sharp 0.35.0-revizly28 → 0.35.0-revizly29
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.
- package/README.md +4 -0
- package/{lib/channel.js → dist/channel.cjs} +1 -1
- package/dist/channel.mjs +177 -0
- package/{lib/colour.js → dist/colour.cjs} +1 -1
- package/dist/colour.mjs +195 -0
- package/{lib/composite.js → dist/composite.cjs} +2 -1
- package/dist/composite.mjs +213 -0
- package/{lib/constructor.js → dist/constructor.cjs} +21 -26
- package/dist/constructor.mjs +500 -0
- package/dist/index.cjs +25 -0
- package/dist/index.mjs +25 -0
- package/{lib/input.js → dist/input.cjs} +14 -3
- package/dist/input.mjs +814 -0
- package/dist/is.mjs +143 -0
- package/{lib/libvips.js → dist/libvips.cjs} +8 -11
- package/dist/libvips.mjs +212 -0
- package/{lib/operation.js → dist/operation.cjs} +2 -2
- package/dist/operation.mjs +987 -0
- package/{lib/output.js → dist/output.cjs} +2 -2
- package/dist/output.mjs +1799 -0
- package/{lib/resize.js → dist/resize.cjs} +1 -1
- package/dist/resize.mjs +611 -0
- package/dist/sharp.cjs +162 -0
- package/dist/sharp.mjs +164 -0
- package/{lib/utility.js → dist/utility.cjs} +8 -6
- package/dist/utility.mjs +295 -0
- package/install/build.js +1 -1
- package/lib/index.d.ts +8 -1
- package/package.json +25 -15
- package/src/binding.gyp +8 -8
- package/src/common.cc +6 -3
- package/src/common.h +2 -0
- package/lib/index.js +0 -16
- package/lib/sharp.js +0 -163
- /package/{lib/is.js → dist/is.cjs} +0 -0
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
const is = require('./is');
|
|
7
|
-
const sharp = require('./sharp');
|
|
6
|
+
const is = require('./is.cjs');
|
|
7
|
+
const sharp = require('./sharp.cjs');
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Justification alignment
|
|
@@ -24,7 +24,7 @@ const align = {
|
|
|
24
24
|
|
|
25
25
|
const inputStreamParameters = [
|
|
26
26
|
// Limits and error handling
|
|
27
|
-
'failOn', 'limitInputPixels', 'unlimited',
|
|
27
|
+
'failOn', 'limitInputPixels', 'limitInputChannels', 'unlimited',
|
|
28
28
|
// Format-generic
|
|
29
29
|
'animated', 'autoOrient', 'density', 'ignoreIcc', 'page', 'pages', 'sequentialRead',
|
|
30
30
|
// Format-specific
|
|
@@ -55,6 +55,7 @@ function _createInputDescriptor (input, inputOptions, containerOptions) {
|
|
|
55
55
|
autoOrient: false,
|
|
56
56
|
failOn: 'warning',
|
|
57
57
|
limitInputPixels: 0x3FFF ** 2,
|
|
58
|
+
limitInputChannels: 5,
|
|
58
59
|
ignoreIcc: false,
|
|
59
60
|
unlimited: false,
|
|
60
61
|
sequentialRead: true
|
|
@@ -150,6 +151,16 @@ function _createInputDescriptor (input, inputOptions, containerOptions) {
|
|
|
150
151
|
throw is.invalidParameterError('limitInputPixels', 'positive integer', inputOptions.limitInputPixels);
|
|
151
152
|
}
|
|
152
153
|
}
|
|
154
|
+
// limitInputChannels
|
|
155
|
+
if (is.defined(inputOptions.limitInputChannels)) {
|
|
156
|
+
if (is.bool(inputOptions.limitInputChannels)) {
|
|
157
|
+
inputDescriptor.limitInputChannels = inputOptions.limitInputChannels ? 5 : 0;
|
|
158
|
+
} else if (is.integer(inputOptions.limitInputChannels) && is.inRange(inputOptions.limitInputChannels, 0, Number.MAX_SAFE_INTEGER)) {
|
|
159
|
+
inputDescriptor.limitInputChannels = inputOptions.limitInputChannels;
|
|
160
|
+
} else {
|
|
161
|
+
throw is.invalidParameterError('limitInputChannels', 'positive integer', inputOptions.limitInputChannels);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
153
164
|
// unlimited
|
|
154
165
|
if (is.defined(inputOptions.unlimited)) {
|
|
155
166
|
if (is.bool(inputOptions.unlimited)) {
|