-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
1.4.0
-
generic
-
generic
I am getting the IIOMetadata object from the JPEG Writer by calling writer.getStreamMetadata(writeParam). This metadata claims to support Native as well as standard metadata formats. I am getting the Node object from this metadata by calling getAsTree(native format name) and trying to merge this node with the same metadata tree. The following exception is thrown by mergeTree():
java.lang.NullPointerException
at com.sun.imageio.plugins.jpeg.MarkerSegment.getAttributeValue(MarkerSegment.java:131)
at com.sun.imageio.plugins.jpeg.JFIFMarkerSegment.updateFromNativeNode(JFIFMarkerSegment.java:240)
at com.sun.imageio.plugins.jpeg.JFIFMarkerSegment.<init>(JFIFMarkerSegment.java:133)
at com.sun.imageio.plugins.jpeg.JPEGMetadata.mergeJFIFsubtree(JPEGMetadata.java:1113)
at com.sun.imageio.plugins.jpeg.JPEGMetadata.mergeNativeTree(JPEGMetadata.java:1091)
at com.sun.imageio.plugins.jpeg.JPEGMetadata.mergeTree(JPEGMetadata.java:1061)
at WriterStreamMetadataTest.<init>(WriterStreamMetadataTest.java:68)
at WriterStreamMetadataTest.main(WriterStreamMetadataTest.java:134)
This is reproducible on all platforms since JDK1.4.
I have attached a sample test. Execute it as follows:
java WriterStreamMetadataTest <format> [merge]
If 'merge' is specified, you would see the above exception for JPEG format. If 'merge' is not specified, the test would still fail reproducing a different bug: 4894894
java.lang.NullPointerException
at com.sun.imageio.plugins.jpeg.MarkerSegment.getAttributeValue(MarkerSegment.java:131)
at com.sun.imageio.plugins.jpeg.JFIFMarkerSegment.updateFromNativeNode(JFIFMarkerSegment.java:240)
at com.sun.imageio.plugins.jpeg.JFIFMarkerSegment.<init>(JFIFMarkerSegment.java:133)
at com.sun.imageio.plugins.jpeg.JPEGMetadata.mergeJFIFsubtree(JPEGMetadata.java:1113)
at com.sun.imageio.plugins.jpeg.JPEGMetadata.mergeNativeTree(JPEGMetadata.java:1091)
at com.sun.imageio.plugins.jpeg.JPEGMetadata.mergeTree(JPEGMetadata.java:1061)
at WriterStreamMetadataTest.<init>(WriterStreamMetadataTest.java:68)
at WriterStreamMetadataTest.main(WriterStreamMetadataTest.java:134)
This is reproducible on all platforms since JDK1.4.
I have attached a sample test. Execute it as follows:
java WriterStreamMetadataTest <format> [merge]
If 'merge' is specified, you would see the above exception for JPEG format. If 'merge' is not specified, the test would still fail reproducing a different bug: 4894894
- relates to
-
JDK-4894894 JPGMetadata.getAsTree() throws IllegalArgException for standard mdata format
-
- Open
-
-
JDK-4896304 PNGMetadata.mergeTree throws exception when node returned by getAsTree is merged
-
- Open
-
-
JDK-4895547 JPEGImageMetadata obtained from reader throws NPE when calling mergeTree()
-
- Closed
-