mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Ensure extractChannel works with 16-bit images #1330
This commit is contained in:
BIN
test/fixtures/expected/extract-alpha-16bit.jpg
vendored
Normal file
BIN
test/fixtures/expected/extract-alpha-16bit.jpg
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 685 B |
@@ -69,6 +69,17 @@ describe('Image channel extraction', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('Alpha from 16-bit PNG', function (done) {
|
||||
const output = fixtures.path('output.extract-alpha-16bit.jpg');
|
||||
sharp(fixtures.inputPngWithTransparency16bit)
|
||||
.extractChannel(3)
|
||||
.toFile(output, function (err, info) {
|
||||
if (err) throw err;
|
||||
fixtures.assertMaxColourDistance(output, fixtures.expected('extract-alpha-16bit.jpg'));
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('Invalid channel number', function () {
|
||||
assert.throws(function () {
|
||||
sharp(fixtures.inputJpg)
|
||||
|
||||
Reference in New Issue
Block a user