Add support for profile-less CMYK images #99

This commit is contained in:
Lovell Fuller
2014-11-06 11:30:19 +00:00
parent 62fcfb3dba
commit f7c2a839ad
7 changed files with 43 additions and 12 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

View File

@@ -13,6 +13,7 @@ module.exports = {
inputJpgWithExifMirroring: getPath('Landscape_5.jpg'), // https://github.com/recurser/exif-orientation-examples/blob/master/Landscape_5.jpg
inputJpgWithGammaHoliness: getPath('gamma_dalai_lama_gray.jpg'), // http://www.4p8.com/eric.brasseur/gamma.html
inputJpgWithCmykProfile: getPath('Channel_digital_image_CMYK_color.jpg'), // http://en.wikipedia.org/wiki/File:Channel_digital_image_CMYK_color.jpg
inputJpgWithCmykNoProfile: getPath('Channel_digital_image_CMYK_color_no_profile.jpg'),
inputPng: getPath('50020484-00001.png'), // http://c.searspartsdirect.com/lis_png/PLDM/50020484-00001.png
inputPngWithTransparency: getPath('blackbug.png'), // public domain

View File

@@ -66,4 +66,16 @@ describe('Colour space conversion', function() {
});
});
it('From profile-less CMYK to sRGB', function(done) {
sharp(fixtures.inputJpgWithCmykNoProfile)
.resize(320)
.toBuffer(function(err, data, info) {
if (err) throw err;
assert.strictEqual(true, data.length > 0);
assert.strictEqual('jpeg', info.format);
assert.strictEqual(320, info.width);
done();
});
});
});