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. 10793-sample2.pdf
        4.03 MB
        Tyler Johnson
      2. 10793-sample3.pdf
        4.32 MB
        Tyler Johnson
      3. sc10326.pdf
        1.06 MB
        Tyler Johnson
      4. sf-10793.pdf
        747 kB
        Tyler Johnson

        Activity

        Tyler Johnson created issue -
        Tyler Johnson made changes -
        Field Original Value New Value
        Salesforce Case [5007000000HzLSq]
        Tyler Johnson made changes -
        Attachment sc10326.pdf [ 13371 ]
        Patrick Corless made changes -
        Workaround Description I've made some colour tweaks on the trunk that seem to help with the reported colour issues. I still need to check to see if this is the JDK 1.5/1.6 colour issue. Targeting for the next release regardless.
        Fix Version/s 4.2.2 [ 10265 ]
        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".
        Patrick Corless made changes -
        Workaround Description I've made some colour tweaks on the trunk that seem to help with the reported colour issues. I still need to check to see if this is the JDK 1.5/1.6 colour issue. Targeting for the next release regardless. This is related PDF-276. Using JDK 1.5 will address the issue.
        Fix Version/s 4.3 [ 10266 ]
        Fix Version/s 4.2.2 [ 10265 ]
        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
        Tyler Johnson made changes -
        Attachment sf-10793.pdf [ 13910 ]
        Tyler Johnson made changes -
        Salesforce Case [5007000000HzLSq] [5007000000HzLSq, 5007000000KDNdh]
        Tyler Johnson made changes -
        Attachment 10793-sample2.pdf [ 13927 ]
        Tyler Johnson made changes -
        Attachment 10793-sample3.pdf [ 13928 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #27074 Mon Jan 02 11:50:52 MST 2012 patrick.corless PDF-319 updated th CYYK to RGB algorithm, improved colour mapping has been achieved by mapping CYYK -> CMYK ->RGB.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/Stream.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #27075 Mon Jan 02 12:03:03 MST 2012 patrick.corless creating new preview tag for PDF-319
        Files Changed
        Commit graph ADD /icepdf/tags/icepdf-4.3.0-preview-2
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #27081 Wed Jan 04 07:24:31 MST 2012 patrick.corless PDF-319 added a jdk 1.5 system check to avoid jpeg decode bug in JDK 1.5 where Red and Blue are reversed for a colour.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/Stream.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #27144 Wed Jan 11 12:07:34 MST 2012 patrick.corless PDF-319 updated the graphic state to start parsing out a new SoftMask dictionary class and cut it into the content parser. We don't yet support all aspect of transparency groups and especially SoftMask but this is a step hopefully in the right direction.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/util/ContentParser.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/GraphicsState.java
        Commit graph ADD /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/SoftMask.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #27145 Wed Jan 11 12:12:27 MST 2012 patrick.corless PDF-319 updated the graphic state to start parsing out a new SoftMask dictionary class and cut it into the content parser. We don't yet support all aspect of transparency groups and especially SoftMask but this is a step hopefully in the right direction.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/ExtGState.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #27147 Wed Jan 11 13:10:14 MST 2012 patrick.corless PDF-319 fixed a regression error in how we cache values cyyk -> cmyk values which was causing some image corruption on decode. Fixed two inverted colour issues, the first related to jpeg2000 decode for seperation colour space and lack of support for the decode array in alterRasterY2Gray.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/Stream.java
        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.
        Patrick Corless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #27219 Tue Jan 17 13:42:23 MST 2012 patrick.corless PDF-319 updated the how we scale images to use nearest neighbor interpolation, this seems to address a corruption we where seeing in the image raster for some CYYK encoded images.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/Stream.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/util/ImageCache.java
        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.
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #32524 Thu Nov 29 15:57:55 MST 2012 patrick.corless PDF-319 addition of initial support for optional content.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/commands/TransformDrawCmd.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/commands/ShapesDrawCmd.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/commands/ShapeDrawCmd.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/commands/AbstractDrawCmd.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/ScaledImageReference.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/PaintTimer.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/commands/NoClipDrawCmd.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/annotations/Annotation.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/ImagePool.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/commands/FormDrawCmd.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/commands/TextSpriteDrawCmd.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/util/Parser.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/PageTree.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/commands/PaintDrawCmd.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/commands/AlphaDrawCmd.java
        Commit graph ADD /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/OptionalContentMembership.java
        Commit graph ADD /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/commands/OCGStartDrawCmd.java
        Commit graph ADD /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/commands/OCGEndDrawCmd.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/text/PageText.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/fonts/CMap.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/commands/TilingPatternDrawCmd.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/views/swing/PageViewComponentImpl.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/fonts/Font.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/CachedImageReference.java
        Commit graph ADD /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/OptionalContent.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/commands/ImageDrawCmd.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/fonts/FontDescriptor.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/Shapes.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/io/BufferedMarkedInputStream.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/OutlineItem.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/commands/ColorDrawCmd.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/Resources.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/commands/DrawDrawCmd.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/util/content/Lexer.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/Form.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/util/Utils.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/ImageStreamReference.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/ImageStream.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/commands/FillDrawCmd.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/ImageReferenceFactory.java
        Commit graph ADD /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/OptionalContents.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/commands/GlyphOutlineDrawCmd.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/MipMappedImageReference.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/ImageReference.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/InlineImageStreamReference.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/util/ContentParser.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/commands/DrawCmd.java
        Commit graph ADD /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/OptionalContentGroup.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/commands/StrokeDrawCmd.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/Catalog.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/GraphicsState.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/Page.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/commands/ClipDrawCmd.java
        Commit graph ADD /icepdf/trunk/icepdf/core/src/org/icepdf/core/util/SoftLRUCache.java
        Commit graph ADD /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/OptionalContentState.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #32525 Thu Nov 29 15:58:32 MST 2012 patrick.corless PDF-319 addition of RI support for optional content.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/viewer/src/org/icepdf/ri/common/SwingController.java
        Commit graph MODIFY /icepdf/trunk/icepdf/viewer/src/org/icepdf/ri/util/PropertiesManager.java
        Commit graph MODIFY /icepdf/trunk/icepdf/viewer/src/org/icepdf/ri/resources/MessageBundle.properties
        Commit graph ADD /icepdf/trunk/icepdf/viewer/src/org/icepdf/ri/common/LayersTree.java
        Commit graph MODIFY /icepdf/trunk/icepdf/viewer/src/org/icepdf/ri/common/SwingViewBuilder.java
        Commit graph ADD /icepdf/trunk/icepdf/viewer/src/org/icepdf/ri/common/LayersTreeNode.java
        Commit graph ADD /icepdf/trunk/icepdf/viewer/src/org/icepdf/ri/common/LayersPanel.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #32527 Thu Nov 29 16:13:31 MST 2012 patrick.corless PDF-319 removed JDK 1.6 method call on ArrayList replacing with JDK 1.5 calls.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/util/ContentParser.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/OptionalContentState.java

          People

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

            Dates

            • Created:
              Updated:
              Resolved: