Skip to content

Commit 98e03b8

Browse files
kleisaukelovell
authored andcommitted
Revert "Guard heif bitdepth property for prebuilt binaries"
This reverts commit aa1bbcb.
1 parent e4ea2f3 commit 98e03b8

2 files changed

Lines changed: 1 addition & 12 deletions

File tree

lib/output.mjs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,6 @@ function tiff (options) {
12061206
* Use these AVIF options for output image.
12071207
*
12081208
* AVIF image sequences are not supported.
1209-
* Prebuilt binaries support a bitdepth of 8 only.
12101209
*
12111210
* When using Windows ARM64, this feature requires a CPU with ARM64v8.4 or later.
12121211
*
@@ -1297,9 +1296,6 @@ function heif (options) {
12971296
}
12981297
if (is.defined(options.bitdepth)) {
12991298
if (is.integer(options.bitdepth) && is.inArray(options.bitdepth, [8, 10, 12])) {
1300-
if (options.bitdepth !== 8 && this.constructor.versions.heif) {
1301-
throw is.invalidParameterError('bitdepth when using prebuilt binaries', 8, options.bitdepth);
1302-
}
13031299
this.options.heifBitdepth = options.bitdepth;
13041300
} else {
13051301
throw is.invalidParameterError('bitdepth', '8, 10 or 12', options.bitdepth);

test/unit/heif.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,10 @@ suite('HEIF', () => {
9393
});
9494
});
9595
test('valid bitdepth value does not throw an error', (t) => {
96-
t.plan(2);
97-
const { heif } = sharp.versions;
98-
delete sharp.versions.heif;
96+
t.plan(1);
9997
t.assert.doesNotThrow(() => {
10098
sharp().heif({ compression: 'av1', bitdepth: 12 });
10199
});
102-
sharp.versions.heif = '1.2.3';
103-
t.assert.throws(() => {
104-
sharp().heif({ compression: 'av1', bitdepth: 10 });
105-
}, /Error: Expected 8 for bitdepth when using prebuilt binaries but received 10 of type number/);
106-
sharp.versions.heif = heif;
107100
});
108101
test('invalid bitdepth value should throw an error', (t) => {
109102
t.plan(1);

0 commit comments

Comments
 (0)