ICEpdf
  1. ICEpdf
  2. PDF-198

PDF requiring JPEG2000 support does not render correctly

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.1
    • Fix Version/s: 4.1.1
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      -

      Description

      The customer has reported that the test PDF renders as black but I have been unable to confirm that behavior. When using 4.1 Pro, the PDF "renders" but the print is not legible and very faint. I also see the following exception thrown:

      FINE: Error painting shapes.
      java.util.ConcurrentModificationException
      at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
      at java.util.AbstractList$Itr.next(AbstractList.java:343)
      at org.icepdf.core.pobjects.graphics.Shapes.paint(Shapes.java:325)
      at org.icepdf.core.pobjects.Page.paint(Page.java:500)

        Activity

        Hide
        Patrick Corless added a comment -

        This is my first dive into the the image handling for quite some time. It turns out there are four images that make up this PDF. The first is a background that is a bit redundant as it is hidden by the other images. The small circular letter head graphic is one but the image that shows up black is actually rendered correctly in the JPEG2000 format. The four image is is a mask in jbig2 format for the previous JPEG2000 image. The Mask is what cuts out all the text from from the JPEG2000 image.

        I've update our code to apply the jbig2 image mask to the JPEG2000 image and the PDF start looking like it should. I still have to find some other examples but I'll likely check in the code regardless as it is a feature that we don't support in the spec at all.

        Show
        Patrick Corless added a comment - This is my first dive into the the image handling for quite some time. It turns out there are four images that make up this PDF. The first is a background that is a bit redundant as it is hidden by the other images. The small circular letter head graphic is one but the image that shows up black is actually rendered correctly in the JPEG2000 format. The four image is is a mask in jbig2 format for the previous JPEG2000 image. The Mask is what cuts out all the text from from the JPEG2000 image. I've update our code to apply the jbig2 image mask to the JPEG2000 image and the PDF start looking like it should. I still have to find some other examples but I'll likely check in the code regardless as it is a feature that we don't support in the spec at all.
        Hide
        Patrick Corless added a comment -

        The masking algorithm seems fast enough but the bbig2 and jpeg2000 handling is a little slow for this file. I've create a new bug, PDF-201 to capture the performance issue, maybe something we can look at in more detail at a later date.

        Show
        Patrick Corless added a comment - The masking algorithm seems fast enough but the bbig2 and jpeg2000 handling is a little slow for this file. I've create a new bug, PDF-201 to capture the performance issue, maybe something we can look at in more detail at a later date.
        Hide
        Patrick Corless added a comment -

        Checked in the explicit mask filter for JPEG2000. This feature should be added to other image type but I can't seem to fine other examples of it. Closing issue.

        Show
        Patrick Corless added a comment - Checked in the explicit mask filter for JPEG2000. This feature should be added to other image type but I can't seem to fine other examples of it. Closing issue.
        Hide
        Tyler Johnson added a comment -

        Using the trunk build that includes a patch for ICE-198, rendering has improved but the background of the image is gray instead of white.

        Show
        Tyler Johnson added a comment - Using the trunk build that includes a patch for ICE-198, rendering has improved but the background of the image is gray instead of white.
        Hide
        Patrick Corless added a comment -

        I'll take a closer look at the colour model being used for the mask.

        Show
        Patrick Corless added a comment - I'll take a closer look at the colour model being used for the mask.
        Hide
        Patrick Corless added a comment -

        Updated the applyExplicitMask method to convert the base image to a full grayscale image. This is seem to fix the grey background colour in the resulting image. Unfortunately I just don't have enough examples of this mask type to be able to infer another other patterns.

        Show
        Patrick Corless added a comment - Updated the applyExplicitMask method to convert the base image to a full grayscale image. This is seem to fix the grey background colour in the resulting image. Unfortunately I just don't have enough examples of this mask type to be able to infer another other patterns.
        Hide
        Patrick Corless added a comment -

        Took another look at this issue when cleaning up the Stream class for the CCITTfax work and found a couple problems with my initial fix.

        Show
        Patrick Corless added a comment - Took another look at this issue when cleaning up the Stream class for the CCITTfax work and found a couple problems with my initial fix.
        Hide
        Patrick Corless added a comment -

        After revisiting this issue I updated the JPEG2000 code to apply colour space information to the image's raster. This seems to fix all our know JPEG2000 colour problems, all our test files render more or less correctly.

        Show
        Patrick Corless added a comment - After revisiting this issue I updated the JPEG2000 code to apply colour space information to the image's raster. This seems to fix all our know JPEG2000 colour problems, all our test files render more or less correctly.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: