Add isPalette and bitsPerSample metadata, deprecate paletteBitDepth

This commit is contained in:
Lovell Fuller
2024-10-29 09:11:19 +00:00
parent 6480a94181
commit 3154af776e
9 changed files with 42 additions and 9 deletions

4
lib/index.d.ts vendored
View File

@@ -1076,6 +1076,10 @@ declare namespace sharp {
chromaSubsampling?: string | undefined;
/** Boolean indicating whether the image is interlaced using a progressive scan */
isProgressive?: boolean | undefined;
/** Boolean indicating whether the image is palette-based (GIF, PNG). */
isPalette?: boolean | undefined;
/** Number of bits per sample for each channel (GIF, PNG). */
bitsPerSample?: number | undefined;
/** Number of pages/frames contained within the image, with support for TIFF, HEIF, PDF, animated GIF and animated WebP */
pages?: number | undefined;
/** Number of pixels high each page in a multi-page image will be. */

View File

@@ -434,9 +434,10 @@ function _isStreamInput () {
* - `density`: Number of pixels per inch (DPI), if present
* - `chromaSubsampling`: String containing JPEG chroma subsampling, `4:2:0` or `4:4:4` for RGB, `4:2:0:4` or `4:4:4:4` for CMYK
* - `isProgressive`: Boolean indicating whether the image is interlaced using a progressive scan
* - `isPalette`: Boolean indicating whether the image is palette-based (GIF, PNG).
* - `bitsPerSample`: Number of bits per sample for each channel (GIF, PNG, HEIF).
* - `pages`: Number of pages/frames contained within the image, with support for TIFF, HEIF, PDF, animated GIF and animated WebP
* - `pageHeight`: Number of pixels high each page in a multi-page image will be.
* - `paletteBitDepth`: Bit depth of palette-based image (GIF, PNG).
* - `loop`: Number of times to loop an animated image, zero refers to a continuous loop.
* - `delay`: Delay in ms between each page in an animated image, provided as an array of integers.
* - `pagePrimary`: Number of the primary page in a HEIF image