mirror of
https://github.com/lovell/sharp.git
synced 2025-12-18 23:05:04 +01:00
Guard heif bitdepth property for prebuilt binaries
This commit is contained in:
@@ -1011,6 +1011,7 @@ function tiff (options) {
|
||||
* Use these AVIF options for output image.
|
||||
*
|
||||
* AVIF image sequences are not supported.
|
||||
* Prebuilt binaries support a bitdepth of 8 only.
|
||||
*
|
||||
* @example
|
||||
* const data = await sharp(input)
|
||||
@@ -1097,6 +1098,9 @@ function heif (options) {
|
||||
}
|
||||
if (is.defined(options.bitdepth)) {
|
||||
if (is.integer(options.bitdepth) && is.inArray(options.bitdepth, [8, 10, 12])) {
|
||||
if (options.bitdepth !== 8 && this.constructor.versions.heif) {
|
||||
throw is.invalidParameterError('bitdepth when using prebuilt binaries', 8, options.bitdepth);
|
||||
}
|
||||
this.options.heifBitdepth = options.bitdepth;
|
||||
} else {
|
||||
throw is.invalidParameterError('bitdepth', '8, 10 or 12', options.bitdepth);
|
||||
|
||||
Reference in New Issue
Block a user