mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Fix 16-bit, 2-channel PNG w/ ICC profile support #2013
This commit is contained in:
BIN
test/fixtures/16-bit-grey-alpha.png
vendored
Normal file
BIN
test/fixtures/16-bit-grey-alpha.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
BIN
test/fixtures/expected/16-bit-grey-alpha-identity.png
vendored
Normal file
BIN
test/fixtures/expected/16-bit-grey-alpha-identity.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
1
test/fixtures/index.js
vendored
1
test/fixtures/index.js
vendored
@@ -79,6 +79,7 @@ module.exports = {
|
||||
inputPngWithGreyAlpha: getPath('grey-8bit-alpha.png'),
|
||||
inputPngWithOneColor: getPath('2x2_fdcce6.png'),
|
||||
inputPngWithTransparency16bit: getPath('tbgn2c16.png'), // http://www.schaik.com/pngsuite/tbgn2c16.png
|
||||
inputPng16BitGreyAlpha: getPath('16-bit-grey-alpha.png'), // CC-BY-NC-SA florc http://www.colourlovers.com/pattern/50713/pat
|
||||
inputPngOverlayLayer0: getPath('alpha-layer-0-background.png'),
|
||||
inputPngOverlayLayer1: getPath('alpha-layer-1-fill.png'),
|
||||
inputPngAlphaPremultiplicationSmall: getPath('alpha-premultiply-1024x768-paper.png'),
|
||||
|
||||
@@ -103,6 +103,15 @@ describe('PNG', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('16-bit grey+alpha PNG identity transform', function () {
|
||||
const actual = fixtures.path('output.16-bit-grey-alpha-identity.png');
|
||||
return sharp(fixtures.inputPng16BitGreyAlpha)
|
||||
.toFile(actual)
|
||||
.then(function () {
|
||||
fixtures.assertMaxColourDistance(actual, fixtures.expected('16-bit-grey-alpha-identity.png'));
|
||||
});
|
||||
});
|
||||
|
||||
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