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

        Tyler Johnson created issue -
        Tyler Johnson made changes -
        Field Original Value New Value
        Environment - JAI
        Salesforce Case [5007000000AqXIj]
        Tyler Johnson made changes -
        Attachment handelsblatt_seite-1.pdf [ 12215 ]
        Patrick Corless made changes -
        Fix Version/s 4.1 [ 10227 ]
        Patrick Corless made changes -
        Assignee Patrick Corless [ patrick.corless ] Mark Collette [ mark.collette ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #22025 Mon Jul 26 12:06:10 MDT 2010 patrick.corless PDF-161 update makeRGBBuffer to use an imageIcon to sure that the image is loaded properly. Also added code to create bufferedImage based on jvm environment.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/Stream.java
        Patrick Corless made changes -
        Assignee Mark Collette [ mark.collette ] Patrick Corless [ patrick.corless ]
        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.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #22031 Tue Jul 27 05:10:38 MDT 2010 patrick.corless PDF-161 updated/cleaned imports.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/TilingPattern.java
        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.
        Patrick Corless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: