mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Expose raw TIFFTAG_PHOTOSHOP metadata #1600
This commit is contained in:
1
test/fixtures/index.js
vendored
1
test/fixtures/index.js
vendored
@@ -97,6 +97,7 @@ module.exports = {
|
||||
inputTiffCielab: getPath('cielab-dagams.tiff'), // https://github.com/lovell/sharp/issues/646
|
||||
inputTiffUncompressed: getPath('uncompressed_tiff.tiff'), // https://code.google.com/archive/p/imagetestsuite/wikis/TIFFTestSuite.wiki file: 0c84d07e1b22b76f24cccc70d8788e4a.tif
|
||||
inputTiff8BitDepth: getPath('8bit_depth.tiff'),
|
||||
inputTifftagPhotoshop: getPath('tifftag-photoshop.tiff'), // https://github.com/lovell/sharp/issues/1600
|
||||
inputGif: getPath('Crash_test.gif'), // http://upload.wikimedia.org/wikipedia/commons/e/e3/Crash_test.gif
|
||||
inputGifGreyPlusAlpha: getPath('grey-plus-alpha.gif'), // http://i.imgur.com/gZ5jlmE.gif
|
||||
inputGifAnimated: getPath('rotating-squares.gif'), // CC0 https://loading.io/spinner/blocks/-rotating-squares-preloader-gif
|
||||
|
||||
BIN
test/fixtures/tifftag-photoshop.tiff
vendored
Normal file
BIN
test/fixtures/tifftag-photoshop.tiff
vendored
Normal file
Binary file not shown.
@@ -515,6 +515,21 @@ describe('Image metadata', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('16-bit TIFF with TIFFTAG_PHOTOSHOP metadata', () =>
|
||||
sharp(fixtures.inputTifftagPhotoshop)
|
||||
.metadata()
|
||||
.then(metadata => {
|
||||
assert.strictEqual(metadata.format, 'tiff');
|
||||
assert.strictEqual(metadata.width, 317);
|
||||
assert.strictEqual(metadata.height, 211);
|
||||
assert.strictEqual(metadata.space, 'rgb16');
|
||||
assert.strictEqual(metadata.channels, 3);
|
||||
assert.strictEqual(typeof metadata.tifftagPhotoshop, 'object');
|
||||
assert.strictEqual(metadata.tifftagPhotoshop instanceof Buffer, true);
|
||||
assert.strictEqual(metadata.tifftagPhotoshop.length, 6634);
|
||||
})
|
||||
);
|
||||
|
||||
it('File input with corrupt header fails gracefully', function (done) {
|
||||
sharp(fixtures.inputJpgWithCorruptHeader)
|
||||
.metadata(function (err) {
|
||||
|
||||
Reference in New Issue
Block a user