ICEpdf
  1. ICEpdf
  2. PDF-710

Gradient is displayed as a black box

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.4
    • Fix Version/s: 5.0.6
    • Component/s: None
    • Labels:
      None
    • Environment:
      JEE application running on GF 3.1.2.2

      Description

      We're setting a stream to a org.icepdf.core.pobjects.Document and get single images via Document#getPageImage. The attached PDF with gradients from a powerpoint presentation is rendered incorrect. Gradient areas result in simple black boxes.
      1. powerpoint with gradient.pdf
        165 kB
        Tim Weller
      1. page1.jpg
        10 kB
      2. page2.jpg
        22 kB
      3. page3.jpg
        15 kB

        Activity

        Tim Weller created issue -
        Tim Weller made changes -
        Field Original Value New Value
        Attachment powerpoint with gradient.pdf [ 16636 ]
        Tim Weller made changes -
        Comment [ input pdf ]
        Tim Weller made changes -
        Attachment page1.jpg [ 16637 ]
        Attachment page2.jpg [ 16638 ]
        Attachment page3.jpg [ 16639 ]
        Patrick Corless made changes -
        Fix Version/s 5.0.6 [ 11381 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #40034 Fri Feb 14 12:03:47 MST 2014 patrick.corless PDF-710 initial checkin of refactorred LZW and Flate decode with an abstraction of predictor functions to a common LZWFlateBaseDecode class. Next step is is to refactor LZWDecode to used a fixed buffer size. .
        Files Changed
        Commit graph ADD /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/filters/LZWFlateBaseDecode.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/filters/FlateDecode.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/filters/LZWDecode.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #40035 Fri Feb 14 13:04:09 MST 2014 patrick.corless PDF-710 initial checkin of refactorred LZW and Flate decode with an abstraction of predictor functions to a common LZWFlateBaseDecode class. Next step is is to refactor LZWDecode to used a fixed buffer size. .
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/filters/LZWFlateBaseDecode.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #40290 Fri Mar 07 13:34:01 MST 2014 patrick.corless PDF-710 follow up check in of lzw decode, chunk/banding is working correctly but still no predictor support.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/filters/LZWDecode.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #40293 Fri Mar 07 15:33:28 MST 2014 patrick.corless PDF-710 backing out lzw changes.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/filters/FlateDecode.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/filters/LZWDecode.java
        Hide
        Patrick Corless added a comment -

        Finally cracked this nut. Long story short, I created a new PredictorDecode class that will be added to the stream decode chain. This approach simplifies the process for LZW and Flate encoded data and avoid any nasty buff fill issue when trying to fill a LZW buffer. Refactored the FlateDecode class so that it no longer does the predictor decode and passes the work off to PredictorDecode class.

        No that the images are properly decoded there appears to be a tiling issue which is keeping the gradients from being painted at the correct size.

        Show
        Patrick Corless added a comment - Finally cracked this nut. Long story short, I created a new PredictorDecode class that will be added to the stream decode chain. This approach simplifies the process for LZW and Flate encoded data and avoid any nasty buff fill issue when trying to fill a LZW buffer. Refactored the FlateDecode class so that it no longer does the predictor decode and passes the work off to PredictorDecode class. No that the images are properly decoded there appears to be a tiling issue which is keeping the gradients from being painted at the correct size.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #40353 Fri Mar 14 13:50:16 MDT 2014 patrick.corless PDF-710 addition of PredictorDecode class for the stream decode chain.
        Files Changed
        Commit graph DEL /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/filters/LZWFlateBaseDecode.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/filters/FlateDecode.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/filters/LZWDecode.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/Stream.java
        Commit graph ADD /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/filters/PredictorDecode.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #40356 Mon Mar 17 13:06:16 MDT 2014 patrick.corless PDF-710 fixed a regression in PredictorDecode class which was trying to predict lzw and none png types.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/filters/PredictorDecode.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #40357 Mon Mar 17 13:12:34 MDT 2014 patrick.corless PDF-710 reverted predictor code that had correct signing and casting logic.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/filters/PredictorDecode.java
        Arran Mccullough made changes -
        Support Case References Support Case #12718 - https://icesoft.my.salesforce.com/5007000000acaJc
        Hide
        Patrick Corless added a comment -

        I've made significant progress on the tiling pattern issue. We are correctly applying the scale factor but there are a few side effects that need to be figured out.

        • when the scale factor falls below 1.0 we have several example where the pattern becomes solid as there issn't suffecient definition to paint a 20x20 tile at lets say 5x5 or 0.25 scale factor.
        • there are several example where the tile step is quite large, for example 2633x2633 which is using a significant amount of memory. I'm pretty sure we can use the true bboxMod as the tile size and apply the step using the bbox that is set with the tile image and get a similar effect without having to create such a large buffer.
        Show
        Patrick Corless added a comment - I've made significant progress on the tiling pattern issue. We are correctly applying the scale factor but there are a few side effects that need to be figured out. when the scale factor falls below 1.0 we have several example where the pattern becomes solid as there issn't suffecient definition to paint a 20x20 tile at lets say 5x5 or 0.25 scale factor. there are several example where the tile step is quite large, for example 2633x2633 which is using a significant amount of memory. I'm pretty sure we can use the true bboxMod as the tile size and apply the step using the bbox that is set with the tile image and get a similar effect without having to create such a large buffer.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #40391 Thu Mar 20 14:43:19 MDT 2014 patrick.corless PDF-710 updated tiling logic to apply scaling of tile space to the base pdf coordinate space.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/TilingPattern.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #40392 Thu Mar 20 14:45:21 MDT 2014 patrick.corless creating of t-systems patch for LZW and tiling improvements, PDF-710.
        Files Changed
        Commit graph ADD /icepdf/tags/icepdf-5.0.5_tsystems
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #40710 Fri Apr 04 08:37:59 MDT 2014 patrick.corless PDF-710 improvements to pattern tiling tile position and scaling.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/TilingPattern.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #40758 Wed Apr 09 14:01:12 MDT 2014 patrick.corless PDF-710 addition of proper offset at any initial zoom. still need to work on a dynamic scale of the tile for small textures that paint as solid color.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/TilingPattern.java
        Hide
        Patrick Corless added a comment -

        Confirmation from client, closing.

        Show
        Patrick Corless added a comment - Confirmation from client, closing.
        Patrick Corless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Patrick Corless made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Tim Weller
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: