Ensure 16-bit input images work with embed option #325

This commit is contained in:
Lovell Fuller
2015-12-23 20:46:49 +00:00
parent fd5b4a131f
commit 61b86744d7
5 changed files with 34 additions and 15 deletions

View File

@@ -68,6 +68,20 @@ describe('Embed', function() {
});
});
it('16-bit PNG with alpha channel', function(done) {
sharp(fixtures.inputPngWithTransparency16bit)
.resize(32, 16)
.embed()
.toBuffer(function(err, data, info) {
if (err) throw err;
assert.strictEqual(true, data.length > 0);
assert.strictEqual('png', info.format);
assert.strictEqual(32, info.width);
assert.strictEqual(16, info.height);
fixtures.assertSimilar(fixtures.expected('embed-16bit.png'), data, done);
});
});
it('Enlarge and embed', function(done) {
sharp(fixtures.inputPngWithOneColor)
.embed()