Skip to content

Commit

Permalink
Add test for profile retention
Browse files Browse the repository at this point in the history
  • Loading branch information
aptomaKetil committed Oct 19, 2021
1 parent 394844e commit 5988a2d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/unit/resize.js
Original file line number Diff line number Diff line change
Expand Up @@ -642,4 +642,22 @@ describe('Resize dimensions', function () {
sharp().resize(null, null, { position: 'unknown' });
});
});

it('retains profile', async () => {
const output = fixtures.path('output.cmyk-profile.jpg');
let transformer = sharp(fixtures.inputJpgWithCmykProfile);
const metadata = await transformer.metadata();
transformer = transformer.toColourspace(metadata.space);

await transformer
.resize(200, 200)
.withMetadata()
.toFile(output);

const info = await sharp(output).metadata();

assert.strictEqual(metadata.space, 'cmyk');
assert.strictEqual(metadata.space, info.space);
assert(metadata.icc.equals(info.icc));
});
});

0 comments on commit 5988a2d

Please sign in to comment.