ICEpdf
  1. ICEpdf
  2. PDF-319

Image in PDF displayed incorrectly (blue)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.2.1
    • Fix Version/s: 4.3
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      -
    • Workaround Description:
      This is related PDF-276. Using JDK 1.5 will address the issue.

      Description

      The portrait images are showing incorrectly in a number of PDFs. The images are tinted in blue.
      1. sf-10793.pdf
        747 kB
        Tyler Johnson
      2. sc10326.pdf
        1.06 MB
        Tyler Johnson
      3. 10793-sample3.pdf
        4.32 MB
        Tyler Johnson
      4. 10793-sample2.pdf
        4.03 MB
        Tyler Johnson

        Activity

        Hide
        Patrick Corless added a comment -

        As mentioned above this issue is related to PDF-276. There is another issue on the first page of the PDF. To the right of the truck there is a white transparent area that should display the vertically aligned text "Reference".

        Show
        Patrick Corless added a comment - As mentioned above this issue is related to PDF-276 . There is another issue on the first page of the PDF. To the right of the truck there is a white transparent area that should display the vertically aligned text "Reference".
        Hide
        Tyler Johnson added a comment -

        Attaching another test case suffering from the same issue - sf-10793.pdf

        Show
        Tyler Johnson added a comment - Attaching another test case suffering from the same issue - sf-10793.pdf
        Hide
        Patrick Corless added a comment -

        The Walmart PDF (10793-sample3.pdf) has a secondary issue related to soft-masks and gradient paint. The soft mask issue can be compensated for by looking for the presence of a soft-mask in the graphics state. If not present then we can fall back to the regular transparency values specified by ca and CA. This doesn't match up perfectly with the spec but provides a slight better rendering as a compromise.

        There is a very subtle gradient painted on the pages 6 -> 13, the gradient uses a type 1 function which isn't currently supported in ICEpdf. In this particular case the type 1 shadding function is actually represented by a straight line and technically would follow the same implementation of a Type 2 axial shading. Some more work would be needed for us to support type 1 shadding, however this is the only example that I have ever encountered.

        Show
        Patrick Corless added a comment - The Walmart PDF (10793-sample3.pdf) has a secondary issue related to soft-masks and gradient paint. The soft mask issue can be compensated for by looking for the presence of a soft-mask in the graphics state. If not present then we can fall back to the regular transparency values specified by ca and CA. This doesn't match up perfectly with the spec but provides a slight better rendering as a compromise. There is a very subtle gradient painted on the pages 6 -> 13, the gradient uses a type 1 function which isn't currently supported in ICEpdf. In this particular case the type 1 shadding function is actually represented by a straight line and technically would follow the same implementation of a Type 2 axial shading. Some more work would be needed for us to support type 1 shadding, however this is the only example that I have ever encountered.
        Hide
        Patrick Corless added a comment -

        There are still a few corner case issues with JDK 1.5 but from my testing JDK 1.6 and up appear to be fine with regards to colour mapping on jpegs. Marking as resolved for now.

        Show
        Patrick Corless added a comment - There are still a few corner case issues with JDK 1.5 but from my testing JDK 1.6 and up appear to be fine with regards to colour mapping on jpegs. Marking as resolved for now.
        Hide
        Patrick Corless added a comment -

        I think I might have finally found the smoking gun. I haven't had much luck reproducing there error but after a very close examination of my environments I noticed that I was running ICEpdf with image scaling turned off which is not the default. When I enabled it I started seeing what "crazy" Tyler was seeing...

        So the colour work I did for correctly mapping cyyk->cmyk->rgb seems to be valid as is the JDK 1.5 bgra vs rgba in JDK 1.6 and higher. Image scaling intend is to save a little memory and speed up the decode process. Scaling is achieved by using a AffineTransformOp using an interpolation of AffineTransformOp.TYPE_BILINEAR which seems to be changing the colour model or the raster data, not sure which. When I switch the interpolation to AffineTransformOp.TYPE_NEAREST_NEIGHBOR everythign to work out nicely.

        Show
        Patrick Corless added a comment - I think I might have finally found the smoking gun. I haven't had much luck reproducing there error but after a very close examination of my environments I noticed that I was running ICEpdf with image scaling turned off which is not the default. When I enabled it I started seeing what "crazy" Tyler was seeing... So the colour work I did for correctly mapping cyyk->cmyk->rgb seems to be valid as is the JDK 1.5 bgra vs rgba in JDK 1.6 and higher. Image scaling intend is to save a little memory and speed up the decode process. Scaling is achieved by using a AffineTransformOp using an interpolation of AffineTransformOp.TYPE_BILINEAR which seems to be changing the colour model or the raster data, not sure which. When I switch the interpolation to AffineTransformOp.TYPE_NEAREST_NEIGHBOR everythign to work out nicely.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: