Ensure withMetadata skips default profile for RGB16 #3773

This commit is contained in:
Lovell Fuller
2023-08-24 18:13:00 +01:00
parent 44a0ee3fd3
commit 95635683ac
6 changed files with 29 additions and 11 deletions

View File

@@ -794,6 +794,17 @@ describe('Image metadata', function () {
assert.strictEqual(intent, 'Perceptual');
});
it('withMetadata does not add default sRGB profile to RGB16', async () => {
const data = await sharp(fixtures.inputJpg)
.resize(32, 24)
.toColorspace('rgb16')
.withMetadata()
.toBuffer();
const metadata = await sharp(data).metadata();
assert.strictEqual(undefined, metadata.icc);
});
it('File input with corrupt header fails gracefully', function (done) {
sharp(fixtures.inputJpgWithCorruptHeader)
.metadata(function (err) {