#265: Fix for old-style JPEG compressed TIFFs with incorrect JPEGInterchangeFormatLength

This commit is contained in:
Harald Kuhr
2016-06-17 16:10:02 +02:00
parent a4a314a0f9
commit c2aa7e3150
3 changed files with 54 additions and 22 deletions
@@ -198,6 +198,20 @@ public class TIFFImageReaderTest extends ImageReaderAbstractTest<TIFFImageReader
}
}
@Test
public void testReadOldStyleJPEGIncorrectJPEGInterchangeFormatLength() throws IOException {
TestData testData = new TestData(getClassLoaderResource("/tiff/old-style-jpeg-bogus-jpeginterchangeformatlength.tif"), new Dimension(1632, 2328));
try (ImageInputStream stream = testData.getInputStream()) {
TIFFImageReader reader = createReader();
reader.setInput(stream);
BufferedImage image = reader.read(0);
assertNotNull(image);
assertEquals(testData.getDimension(0), new Dimension(image.getWidth(), image.getHeight()));
}
}
@Test
public void testReadIncompatibleICCProfileIgnoredWithWarning() throws IOException {
TestData testData = new TestData(getClassLoaderResource("/tiff/rgb-with-embedded-cmyk-icc.tif"), new Dimension(1500, 1500));