ICEpdf
  1. ICEpdf
  2. PDF-716

Image that are 1xH or Wx1 pixels are not always painted by Java2D

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.5
    • Fix Version/s: 5.0.6
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      any

      Description

      A client has sent us a PDF document that uses long or wide images that are only 1 pix in one direction. Either our clipping checks or Java2d is not painting the image, further investigation is needed.

        Activity

        Hide
        Patrick Corless added a comment -

        Added test case to \\iceads1\support\PDF\700\716

        Show
        Patrick Corless added a comment - Added test case to \\iceads1\support\PDF\700\716
        Hide
        Patrick Corless added a comment -

        I've been looking at this problem for a couple days and I think we're looking at the rounding issue when painting narrow image in Java2D output device. The result of which is a new algorithm that check the images dimension at paint time against the current zoom level. If the image is less then a certain threshold we then apply a scale factor in the axis in question. The scale factor is derived from a lookup table that returns the minim number of pixels that must be present for Java2d to draw the image.

        Show
        Patrick Corless added a comment - I've been looking at this problem for a couple days and I think we're looking at the rounding issue when painting narrow image in Java2D output device. The result of which is a new algorithm that check the images dimension at paint time against the current zoom level. If the image is less then a certain threshold we then apply a scale factor in the axis in question. The scale factor is derived from a lookup table that returns the minim number of pixels that must be present for Java2d to draw the image.
        Hide
        Patrick Corless added a comment -

        This feature is disable by default and can be enabled with org.icepdf.core.imageDrawCmd.scale.enabled=true. Also the default max dimension to apply the scale is defined by org.icepdf.core.imageDrawCmd.maxDimension and the default is 5.

        This approach isn't perfect but it does improve the render quality of the text documents associated with the case. I"ll do a round of QA to see if the how many times the code is actually executed.

        Show
        Patrick Corless added a comment - This feature is disable by default and can be enabled with org.icepdf.core.imageDrawCmd.scale.enabled=true. Also the default max dimension to apply the scale is defined by org.icepdf.core.imageDrawCmd.maxDimension and the default is 5. This approach isn't perfect but it does improve the render quality of the text documents associated with the case. I"ll do a round of QA to see if the how many times the code is actually executed.
        Hide
        Patrick Corless added a comment -

        Marking as fixed.

        Show
        Patrick Corless added a comment - Marking as fixed.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: