Ensure ICC profiles are removed from PNG output #521

This commit is contained in:
Lovell Fuller
2016-07-21 16:49:27 +01:00
parent 9ddc817a09
commit 032bb7e96b
3 changed files with 28 additions and 2 deletions

View File

@@ -328,6 +328,22 @@ describe('Image metadata', function() {
});
});
it('Remove metadata from PNG output', function(done) {
sharp(fixtures.inputJpgWithExif)
.png()
.toBuffer(function(err, buffer) {
if (err) throw err;
sharp(buffer).metadata(function(err, metadata) {
if (err) throw err;
assert.strictEqual(false, metadata.hasProfile);
assert.strictEqual('undefined', typeof metadata.orientation);
assert.strictEqual('undefined', typeof metadata.exif);
assert.strictEqual('undefined', typeof metadata.icc);
done();
});
});
});
it('File input with corrupt header fails gracefully', function(done) {
sharp(fixtures.inputJpgWithCorruptHeader)
.metadata(function(err) {