-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b147
The following code will fail with varying exceptions depending on the exact situation:
ImageInputStream iis; // initialization assumed
ImageReader reader =
ImageIO.getImageReadersByFormatName("TIFF").next();
TIFFImageReadParam param = new TIFFImageReadParam();
param.removeAllowedTagSet(BaselineTIFFTagSet.getInstance());
reader.setInput(iis, false, true);
BufferedImage image = reader.read(0, param); // fails here
For example:
Exception in thread "main" javax.imageio.IIOException: Insufficient data offsets or byte counts
at com.sun.imageio.plugins.tiff.TIFFIFD.checkFieldOffsets(java.desktop/TIFFIFD.java:460)
The BaselineTIFFTagSet contains some fields which are essential for reading the data and should never be ignored.
ImageInputStream iis; // initialization assumed
ImageReader reader =
ImageIO.getImageReadersByFormatName("TIFF").next();
TIFFImageReadParam param = new TIFFImageReadParam();
param.removeAllowedTagSet(BaselineTIFFTagSet.getInstance());
reader.setInput(iis, false, true);
BufferedImage image = reader.read(0, param); // fails here
For example:
Exception in thread "main" javax.imageio.IIOException: Insufficient data offsets or byte counts
at com.sun.imageio.plugins.tiff.TIFFIFD.checkFieldOffsets(java.desktop/TIFFIFD.java:460)
The BaselineTIFFTagSet contains some fields which are essential for reading the data and should never be ignored.
- relates to
-
JDK-8154058 [TIFF] ignoreMetadata parameter of TIFFImageReader's setInput() method affects TIFFImageReadParam in non-obvious way
-
- Resolved
-