mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-04 20:15:28 -04:00
#1058: JPEG fix ClassCastException for Unknown segments
This commit is contained in:
parent
34c9b9b4b5
commit
9610256ddb
@ -268,7 +268,8 @@ class JPEGImage10Metadata extends AbstractMetadata {
|
||||
default:
|
||||
IIOMetadataNode unknown = new IIOMetadataNode("unknown");
|
||||
unknown.setAttribute("MarkerTag", String.valueOf(segment.marker & 0xFF));
|
||||
unknown.setUserObject(((Application) segment).data);
|
||||
byte[] data = segment instanceof Application ? ((Application) segment).data : ((Unknown) segment).data;
|
||||
unknown.setUserObject(data);
|
||||
markerSequence.appendChild(unknown);
|
||||
|
||||
break;
|
||||
|
@ -114,7 +114,8 @@ public class JPEGImageReaderTest extends ImageReaderAbstractTest<JPEGImageReader
|
||||
new TestData(getClassLoaderResource("/jpeg-lossless/24_ls.jpg"), new Dimension(800, 535)), // Lossless RGB, 8 bit per component (24 bit)
|
||||
new TestData(getClassLoaderResource("/jpeg-lossless/f-18.jpg"), new Dimension(320, 240)), // Lossless RGB, 3 DHTs
|
||||
new TestData(getClassLoaderResource("/jpeg-lossless/testimg_rgb.jpg"), new Dimension(227, 149)), // Lossless RGB, 8 bit per component (24 bit)
|
||||
new TestData(getClassLoaderResource("/jpeg-lossless/testimg_gray.jpg"), new Dimension(512, 512)) // Lossless gray, 16 bit
|
||||
new TestData(getClassLoaderResource("/jpeg-lossless/testimg_gray.jpg"), new Dimension(512, 512)), // Lossless gray, 16 bit
|
||||
new TestData(getClassLoaderResource("/jpeg/dnl-marker.jpg"), new Dimension(194, 132)) // Define Number of Lines marker
|
||||
);
|
||||
|
||||
// More test data in specific tests below
|
||||
|
BIN
imageio/imageio-jpeg/src/test/resources/jpeg/dnl-marker.jpg
Normal file
BIN
imageio/imageio-jpeg/src/test/resources/jpeg/dnl-marker.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
Loading…
x
Reference in New Issue
Block a user