Ensure keepIccProfile avoids ICC transform #4186

This commit is contained in:
Lovell Fuller
2024-08-11 09:44:53 +01:00
parent f7ed9b7fb6
commit 2eb03b0049
5 changed files with 16 additions and 0 deletions

View File

@@ -601,6 +601,17 @@ describe('Image metadata', function () {
assert.strictEqual(description, 'Generic RGB Profile');
});
it('keep existing ICC profile, avoid colour transform', async () => {
const [r, g, b] = await sharp(fixtures.inputPngWithProPhotoProfile)
.keepIccProfile()
.raw()
.toBuffer();
assert.strictEqual(r, 131);
assert.strictEqual(g, 141);
assert.strictEqual(b, 192);
});
it('keep existing CMYK ICC profile', async () => {
const data = await sharp(fixtures.inputJpgWithCmykProfile)
.pipelineColourspace('cmyk')