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

        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.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: