Skip to content

Commit cbf0cb3

Browse files
glenn.volckaertguustysebie
authored andcommitted
Add test for corrupt CCITT tif image.
DEVSIX-5565
1 parent acdfde5 commit cbf0cb3

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

io/src/test/java/com/itextpdf/io/image/TiffTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,18 @@ public void group3CompressionCreateTiffImageTest() throws MalformedURLException
136136
createTiff(sourceFile, 1, 1024D, 768D);
137137
}
138138

139+
@Test
140+
public void group3CompressionEolErrorCreateTiffImageTest() throws MalformedURLException {
141+
String sourceFile = SOURCE_FOLDER + "group3CompressionImageWithEolError.tif";
142+
143+
Exception e = Assert.assertThrows(com.itextpdf.io.exceptions.IOException.class,
144+
() -> createTiff(sourceFile, 1, 1024D, 768D));
145+
146+
Assert.assertEquals(MessageFormatUtil.format(
147+
com.itextpdf.io.exceptions.IOException.CannotReadTiffImage), e.getMessage());
148+
}
149+
150+
139151
@Test
140152
public void group3CompressionCreateImageDataTest() throws MalformedURLException {
141153
String sourceFile = SOURCE_FOLDER + "group3CompressionImage.tif";

0 commit comments

Comments
 (0)