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

        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.
        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.
        Hide
        Patrick Corless added a comment -

        Confirmation from client, closing.

        Show
        Patrick Corless added a comment - Confirmation from client, closing.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: