ICEpdf
  1. ICEpdf
  2. PDF-458

Cannot display image with zero width

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.3.3
    • Fix Version/s: 4.3.4
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      any

      Description

      This issue is a continuation of PDF-434. The file in question has two images, each of which has a width that is a PDF reference which is not define in the file. I updated the code in PDF-434 to use the height value if the width could not be resolved. This allows for the image to show up but the image is skewed as the height value isn't the correct value.

      Because this issue is such a corner case I could probably deduce the width from the page size ratio and it should be very low risk to other images.

        Activity

        Patrick Corless created issue -
        Arran Mccullough made changes -
        Field Original Value New Value
        Salesforce Case [5007000000MG2ZH]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #30568 Tue Aug 21 15:19:32 MDT 2012 patrick.corless PDF-458 fix for rare corner case/ male formed pdf where a ccittfax image does not specify an image height.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/util/Defs.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/Stream.java
        Hide
        Patrick Corless added a comment -

        I've revisited this issue and have tried to come up with fix that will detect the page size and try derive the missing image dimension. This method will always assume a legal page size but can be over ridden using the property org.icepdf.core.pageRatio. I don't particularly like this fix but the Stream object has no visibility to the parent Page object. The only other consolation is that this is a one off malformed PDF that is missing a required property. Because of the compression type there is now accurate way to figure out the missing dimension using the bits per colour and stream length.

        Show
        Patrick Corless added a comment - I've revisited this issue and have tried to come up with fix that will detect the page size and try derive the missing image dimension. This method will always assume a legal page size but can be over ridden using the property org.icepdf.core.pageRatio. I don't particularly like this fix but the Stream object has no visibility to the parent Page object. The only other consolation is that this is a one off malformed PDF that is missing a required property. Because of the compression type there is now accurate way to figure out the missing dimension using the bits per colour and stream length.
        Patrick Corless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #30772 Mon Sep 10 10:44:18 MDT 2012 patrick.corless PDF-458 fix for rare corner case/ male formed pdf where a ccittfax image does not specify an image height.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-4.3.3/icepdf/core/src/org/icepdf/core/util/Defs.java
        Commit graph MODIFY /icepdf/branches/icepdf-4.3.3/icepdf
        Commit graph MODIFY /icepdf/branches/icepdf-4.3.3/icepdf/core/src/org/icepdf/core/pobjects/Stream.java
        Patrick Corless made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: