ICEpdf
  1. ICEpdf
  2. PDF-161

Not a JPEG file: starts with 0x0a 0xff

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1, 4.0.1
    • Fix Version/s: 4.1
    • Component/s: Unknown
    • Labels:
      None
    • Environment:
      JAI

      Description

      Feb 17, 2010 9:20:47 PM org.icepdf.core.pobjects.Stream dctDecode
      FINE: Problem loading JPEG image via JPEGImageDecoder:
      com.sun.image.codec.jpeg.ImageFormatException: Not a JPEG file: starts with 0x0a 0xff
      at sun.awt.image.codec.JPEGImageDecoderImpl.readJPEGStream(Native Method)
      at sun.awt.image.codec.JPEGImageDecoderImpl.decodeAsRaster(JPEGImageDecoderImpl.java:187)
      at org.icepdf.core.pobjects.Stream.dctDecode(Stream.java:701)
      at org.icepdf.core.pobjects.Stream.decodeCCITTFaxDecodeOrDCTDecodeOrJBIG2DecodeImage(Stream.java:540)
      at org.icepdf.core.pobjects.Stream.getImage(Stream.java:1741)
      at org.icepdf.core.pobjects.Stream.getImage(Stream.java:1704)
      at org.icepdf.core.util.ContentParser.parseInlineImage(ContentParser.java:1559)
      at org.icepdf.core.util.ContentParser.parse(ContentParser.java:799)
      at org.icepdf.core.pobjects.Form.init(Form.java:185)
      at org.icepdf.core.util.ContentParser.parse(ContentParser.java:410)
      at org.icepdf.core.pobjects.Page.init(Page.java:369)
      at org.icepdf.core.views.swing.PageViewComponentImpl$PageInitilizer.run(PageViewComponentImpl.java:1088)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:637)
      Error: One factory fails for the operation "jpeg"
      Occurs in: javax.media.jai.ThreadSafeOperationRegistry
      java.lang.reflect.InvocationTargetException

        Activity

        Hide
        Patrick Corless added a comment -

        Looks like JAI can't handle the embedded images but the standard JDK can without any problem. Unfortunately JAI dumps quite a bit to the logs. The stream class makeRGBABufferedImageFromImage(Image img)BufferedImage has some old sleep code that is causing the JDK to go into an infinit loop. I'm not sure that sleeping here is the best thing to do. Once removed everything loads as expected.

        I'm going to mark this as fixed but will give it another look later as there is still a little mystery as to how to handle this correctly.

        Show
        Patrick Corless added a comment - Looks like JAI can't handle the embedded images but the standard JDK can without any problem. Unfortunately JAI dumps quite a bit to the logs. The stream class makeRGBABufferedImageFromImage(Image img)BufferedImage has some old sleep code that is causing the JDK to go into an infinit loop. I'm not sure that sleeping here is the best thing to do. Once removed everything loads as expected. I'm going to mark this as fixed but will give it another look later as there is still a little mystery as to how to handle this correctly.
        Hide
        Patrick Corless added a comment -

        checked in new image to buffered image code.

        Show
        Patrick Corless added a comment - checked in new image to buffered image code.

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Tyler Johnson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: