mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2026-05-01 00:00:02 -04:00
TMI-18: Better filtering of APP segments, now only takes 'Exif' APP1 segments into account.
+ Updated failing test.
This commit is contained in:
+8
-5
@@ -102,7 +102,7 @@ public class JPEGSegmentImageInputStreamTest {
|
||||
|
||||
assertThat(length, new LessOrEqual<Long>(10203l)); // In no case should length increase
|
||||
|
||||
assertEquals(9495l, length); // May change, if more chunks are passed to reader...
|
||||
assertEquals(9625l, length); // May change, if more chunks are passed to reader...
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -110,14 +110,17 @@ public class JPEGSegmentImageInputStreamTest {
|
||||
ImageInputStream stream = new JPEGSegmentImageInputStream(ImageIO.createImageInputStream(getClassLoaderResource("/jpeg/no-image-types-rgb-us-web-coated-v2-ms-photogallery-exif.jpg")));
|
||||
List<JPEGSegment> appSegments = JPEGSegmentUtil.readSegments(stream, JPEGSegmentUtil.APP_SEGMENTS);
|
||||
|
||||
assertEquals(2, appSegments.size());
|
||||
assertEquals(3, appSegments.size());
|
||||
|
||||
assertEquals(JPEG.APP0, appSegments.get(0).marker());
|
||||
assertEquals("JFIF", appSegments.get(0).identifier());
|
||||
|
||||
assertEquals(JPEG.APP14, appSegments.get(1).marker());
|
||||
assertEquals("Adobe", appSegments.get(1).identifier());
|
||||
assertEquals(JPEG.APP1, appSegments.get(1).marker());
|
||||
assertEquals("Exif", appSegments.get(1).identifier());
|
||||
|
||||
// And thus, no Exif, no ICC_PROFILE or other segments
|
||||
assertEquals(JPEG.APP14, appSegments.get(2).marker());
|
||||
assertEquals("Adobe", appSegments.get(2).identifier());
|
||||
|
||||
// And thus, no XMP, no ICC_PROFILE or other segments
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user