Improve error messaging when only warnings issued #4465

This commit is contained in:
Lovell Fuller
2025-10-17 14:57:38 +01:00
parent b7fda60a85
commit c1c16ed3e6
6 changed files with 24 additions and 2 deletions

BIN
test/fixtures/bonne.geo.tif vendored Normal file

Binary file not shown.

View File

@@ -113,6 +113,7 @@ module.exports = {
inputTiff8BitDepth: getPath('8bit_depth.tiff'),
inputTifftagPhotoshop: getPath('tifftag-photoshop.tiff'), // https://github.com/lovell/sharp/issues/1600
inputTiffFogra: getPath('fogra-0-100-100-0.tif'), // https://github.com/lovell/sharp/issues/4045
inputTiffGeo: getPath('bonne.geo.tif'), // https://download.osgeo.org/geotiff/samples/intergraph
inputJp2: getPath('relax.jp2'), // https://www.fnordware.com/j2k/relax.jp2
inputJp2TileParts: getPath('relax_tileparts.jp2'), // kdu_expand -i relax.jp2 -o relax-tmp.tif ; kdu_compress -i relax-tmp.tif -o relax_tileparts.jp2 -jp2_space sRGB Clayers=8 -rate 1.0,0.04 Stiles='{128,128}' ORGtparts=L ; rm relax-tmp.tif

View File

@@ -103,4 +103,11 @@ describe('failOn', () => {
fs.createReadStream(fixtures.inputJpgTruncated).pipe(writable);
return writable.toBuffer();
});
it('converts warnings to error for GeoTIFF', async () => {
await assert.rejects(
sharp(fixtures.inputTiffGeo).toBuffer(),
/Unknown field with tag 33550/
);
});
});