Skip to main content

NullPointerException when reading JP2 metadata

3 replies [Last post]
scyudits
Offline
Joined: 2005-07-15

Hi,

I am getting the following exception for some of my jp2 images when I call ImageReader.getImageMetadata(0). When I try these same images in a JP2 viewer like Yakoa, they display fine. Why is this happening?

java.lang.NullPointerException
at com.sun.media.imageioimpl.plugins.jpeg2000.J2KMetadata.replace(J2KMetadata.java:901)
at com.sun.media.imageioimpl.plugins.jpeg2000.J2KMetadata.addNode(J2KMetadata.java:570)
at jj2000.j2k.fileformat.reader.FileFormatReader.readFileFormat(FileFormatReader.java:276)
at com.sun.media.imageioimpl.plugins.jpeg2000.J2KMetadata.(J2KMetadata.java:116)
at com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReader.getImageMetadata(J2KImageReader.java:324)

Thanks,

Sophia

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Brian Burkhalter

Based on this information alone it would be impossible to say. Do you have a
sample image and code for this?

Brian

On Wed, 31 Jan 2007, jai-imageio@javadesktop.org wrote:

> Hi,
>
> I am getting the following exception for some of my jp2 images when I call ImageReader.getImageMetadata(0). When I try these same images in a JP2 viewer like Yakoa, they display fine. Why is this happening?
>
> java.lang.NullPointerException
> at com.sun.media.imageioimpl.plugins.jpeg2000.J2KMetadata.replace(J2KMetadata.java:901)
> at com.sun.media.imageioimpl.plugins.jpeg2000.J2KMetadata.addNode(J2KMetadata.java:570)
> at jj2000.j2k.fileformat.reader.FileFormatReader.readFileFormat(FileFormatReader.java:276)
> at com.sun.media.imageioimpl.plugins.jpeg2000.J2KMetadata.(J2KMetadata.java:116)
> at com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReader.getImageMetadata(J2KImageReader.java:324)
>
>
> Thanks,
>
> Sophia

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

scyudits
Offline
Joined: 2005-07-15

Yes, will send, thanks.

Brian Burkhalter

In testing the images you sent I determined that the problem was due to the
reader not being robust to an unknown box. I have filed an issue here

https://jai-imageio-core.dev.java.net/issues/show_bug.cgi?id=113

which describes the problem. Those who are interested in it may read the
description there and vote for the issue.

Brian

On Wed, 31 Jan 2007, jai-imageio@javadesktop.org wrote:

> Yes, will send, thanks.
> [Message sent by forum member 'scyudits' (scyudits)]
>
> http://forums.java.net/jive/thread.jspa?messageID=200476
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>
>

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net