Skip to content

Commit

Permalink
Tests: only need to assert 'mean' of 16-bit PNG roundtrip
Browse files Browse the repository at this point in the history
  • Loading branch information
lovell committed Nov 23, 2021
1 parent afab0d3 commit 549219f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test/unit/png.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,15 @@ describe('PNG', function () {
.toColourspace('grey16')
.toBuffer();

const [statsBefore, statsAfter] = await Promise.all([
sharp(fixtures.inputPng16BitGreyAlpha).stats(),
sharp(after).stats()
]);
assert.deepStrictEqual(statsAfter.channels[1], statsBefore.channels[1]);
const [alphaMeanBefore, alphaMeanAfter] = (
await Promise.all([
sharp(fixtures.inputPng16BitGreyAlpha).stats(),
sharp(after).stats()
])
)
.map(stats => stats.channels[1].mean);

assert.strictEqual(alphaMeanAfter, alphaMeanBefore);
});

it('Valid PNG libimagequant palette value does not throw error', function () {
Expand Down

0 comments on commit 549219f

Please sign in to comment.