mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Ensure 16-bit PNG output uses correct bitdepth #2958
This commit is contained in:
committed by
Lovell Fuller
parent
2a0077c481
commit
2deced0fb9
@@ -112,6 +112,18 @@ describe('PNG', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('16-bit grey+alpha PNG roundtrip', async () => {
|
||||
const after = await sharp(fixtures.inputPng16BitGreyAlpha)
|
||||
.toColourspace('grey16')
|
||||
.toBuffer();
|
||||
|
||||
const [statsBefore, statsAfter] = await Promise.all([
|
||||
sharp(fixtures.inputPng16BitGreyAlpha).stats(),
|
||||
sharp(after).stats()
|
||||
]);
|
||||
assert.deepStrictEqual(statsAfter.channels[1], statsBefore.channels[1]);
|
||||
});
|
||||
|
||||
it('Valid PNG libimagequant palette value does not throw error', function () {
|
||||
assert.doesNotThrow(function () {
|
||||
sharp().png({ palette: false });
|
||||
|
||||
Reference in New Issue
Block a user