ICEpdf
  1. ICEpdf
  2. PDF-758

NullPointerException - J2KMetadata.replace()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 5.0.6_P01
    • Fix Version/s: 5.1
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      All

      Description

      With the provided package the following NPE is thrown when trying to render the PDF file:

      WARNUNG: Error loading image: 12 0R Image stream= {BitsPerComponent=8, Name=X, Filter=JPXDecode, Subtype=Image, Type=XObject, Length=17066, Height=116
      9, Width=827, ColorSpace=DeviceGray} 12 0R
      java.lang.NullPointerException
      at com.sun.media.imageioimpl.plugins.jpeg2000.J2KMetadata.replace(J2KMetadata.java:962)
      at com.sun.media.imageioimpl.plugins.jpeg2000.J2KMetadata.addNode(J2KMetadata.java:631)
      at com.sun.media.imageioimpl.plugins.jpeg2000.J2KRenderedImageCodecLib.readImageMetadata(J2KRenderedImageCodecLib.java:1006)
      at com.sun.media.imageioimpl.plugins.jpeg2000.J2KRenderedImageCodecLib.createOriginalSampleModel(J2KRenderedImageCodecLib.java:673)
      at com.sun.media.imageioimpl.plugins.jpeg2000.J2KRenderedImageCodecLib.<init>(J2KRenderedImageCodecLib.java:261)
      at com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReaderCodecLib.read(J2KImageReaderCodecLib.java:364)
      at javax.imageio.ImageIO.read(ImageIO.java:1422)
      at org.icepdf.core.pobjects.ImageStream.jpxDecode(ImageStream.java:769)
      at org.icepdf.core.pobjects.ImageStream.getImage(ImageStream.java:381)
      at org.icepdf.core.pobjects.ImageStream.getImage(ImageStream.java:308)
      at org.icepdf.core.pobjects.graphics.ImageStreamReference.call(ImageStreamReference.java:70)
      at org.icepdf.core.pobjects.graphics.ImageStreamReference.call(ImageStreamReference.java:39)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

        Activity

        Hide
        Patrick Corless added a comment -

        Arran; the test/sample program provided runs correctly on my system. Was the client reporting the same error?

        Show
        Patrick Corless added a comment - Arran; the test/sample program provided runs correctly on my system. Was the client reporting the same error?
        Hide
        Patrick Corless added a comment -

        Unfortunately the JAI IO jars have not been updated since 2006 and currently stand at 1.0_01. According to the release notes posted here, http://www.oracle.com/technetwork/java/release-jai-imageio-1-0-01-140367.html, bug:

        4919763 J2KMetadata throws exception when convert standard metadata to native

        I've tried finda

        Might be the root of the problem and possibly wasn't ported to the native code for windows but this is just a guess. There is currently no native source code publicly available for this library so there isn't much we can do address the issue. Currently the only work around is to disable the native codec lib files with -Dcom.sun.media.imageio.disableCodecLib=true .

        As a side note, there seems to be relatively active Imageio project java.net, https://java.net/projects/imageio-ext . There appears to be no native library support but the library might add improved JPEG decoding moving forward.

        Show
        Patrick Corless added a comment - Unfortunately the JAI IO jars have not been updated since 2006 and currently stand at 1.0_01. According to the release notes posted here, http://www.oracle.com/technetwork/java/release-jai-imageio-1-0-01-140367.html , bug: 4919763 J2KMetadata throws exception when convert standard metadata to native I've tried finda Might be the root of the problem and possibly wasn't ported to the native code for windows but this is just a guess. There is currently no native source code publicly available for this library so there isn't much we can do address the issue. Currently the only work around is to disable the native codec lib files with -Dcom.sun.media.imageio.disableCodecLib=true . As a side note, there seems to be relatively active Imageio project java.net, https://java.net/projects/imageio-ext . There appears to be no native library support but the library might add improved JPEG decoding moving forward.
        Hide
        Patrick Corless added a comment -

        Marking as won't fix as there appears to be a valid work around for this issue on none windows systems.

        Show
        Patrick Corless added a comment - Marking as won't fix as there appears to be a valid work around for this issue on none windows systems.

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: