Tests: reduce time taken by metadata tests

This commit is contained in:
Lovell Fuller 2021-01-26 19:52:33 +00:00
parent 67213ae86c
commit 171aade9cd
3 changed files with 2 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 424 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 MiB

After

Width:  |  Height:  |  Size: 943 KiB

View File

@ -504,6 +504,7 @@ describe('Image metadata', function () {
it('Apply CMYK output ICC profile', function (done) { it('Apply CMYK output ICC profile', function (done) {
const output = fixtures.path('output.icc-cmyk.jpg'); const output = fixtures.path('output.icc-cmyk.jpg');
sharp(fixtures.inputJpg) sharp(fixtures.inputJpg)
.resize(64)
.withMetadata({ icc: 'cmyk' }) .withMetadata({ icc: 'cmyk' })
.toFile(output, function (err, info) { .toFile(output, function (err, info) {
if (err) throw err; if (err) throw err;
@ -528,11 +529,11 @@ describe('Image metadata', function () {
it('Apply custom output ICC profile', function (done) { it('Apply custom output ICC profile', function (done) {
const output = fixtures.path('output.hilutite.jpg'); const output = fixtures.path('output.hilutite.jpg');
sharp(fixtures.inputJpg) sharp(fixtures.inputJpg)
.resize(64)
.withMetadata({ icc: fixtures.path('hilutite.icm') }) .withMetadata({ icc: fixtures.path('hilutite.icm') })
.toFile(output, function (err, info) { .toFile(output, function (err, info) {
if (err) throw err; if (err) throw err;
fixtures.assertMaxColourDistance(output, fixtures.path('expected/hilutite.jpg'), 0); fixtures.assertMaxColourDistance(output, fixtures.path('expected/hilutite.jpg'), 0);
fixtures.assertMaxColourDistance(output, fixtures.inputJpg, 16.5);
done(); done();
}); });
}); });