mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Add isPalette and bitsPerSample metadata, deprecate paletteBitDepth
This commit is contained in:
@@ -146,6 +146,8 @@ describe('PNG', function () {
|
||||
density: 72,
|
||||
depth: 'uchar',
|
||||
isProgressive: false,
|
||||
isPalette: true,
|
||||
bitsPerSample: 8,
|
||||
paletteBitDepth: 8,
|
||||
hasProfile: false,
|
||||
hasAlpha: false
|
||||
@@ -218,8 +220,10 @@ describe('PNG', function () {
|
||||
.png({ colours: 2, palette: false })
|
||||
.toBuffer();
|
||||
|
||||
const { channels, paletteBitDepth, size, space } = await sharp(data).metadata();
|
||||
const { channels, isPalette, bitsPerSample, paletteBitDepth, size, space } = await sharp(data).metadata();
|
||||
assert.strictEqual(channels, 1);
|
||||
assert.strictEqual(isPalette, false);
|
||||
assert.strictEqual(bitsPerSample, 1);
|
||||
assert.strictEqual(paletteBitDepth, undefined);
|
||||
assert.strictEqual(size, 89);
|
||||
assert.strictEqual(space, 'b-w');
|
||||
|
||||
Reference in New Issue
Block a user