mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 18:40:16 +02:00
Tests: add assertion to existing scenario #3357
This commit is contained in:
parent
891cf67d0b
commit
1b0eb6ab53
@ -128,11 +128,25 @@ describe('PNG', function () {
|
|||||||
assert.strictEqual(alphaMeanAfter, alphaMeanBefore);
|
assert.strictEqual(alphaMeanAfter, alphaMeanBefore);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('palette decode/encode roundtrip', () =>
|
it('palette decode/encode roundtrip', async () => {
|
||||||
sharp(fixtures.inputPngPalette)
|
const data = await sharp(fixtures.inputPngPalette)
|
||||||
.png({ effort: 1, palette: true })
|
.png({ effort: 1, palette: true })
|
||||||
.toBuffer()
|
.toBuffer();
|
||||||
);
|
|
||||||
|
const { size, ...metadata } = await sharp(data).metadata();
|
||||||
|
assert.deepStrictEqual(metadata, {
|
||||||
|
format: 'png',
|
||||||
|
width: 68,
|
||||||
|
height: 68,
|
||||||
|
space: 'srgb',
|
||||||
|
channels: 3,
|
||||||
|
depth: 'uchar',
|
||||||
|
isProgressive: false,
|
||||||
|
paletteBitDepth: 8,
|
||||||
|
hasProfile: false,
|
||||||
|
hasAlpha: false
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('Valid PNG libimagequant palette value does not throw error', function () {
|
it('Valid PNG libimagequant palette value does not throw error', function () {
|
||||||
assert.doesNotThrow(function () {
|
assert.doesNotThrow(function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user