ICEpdf
  1. ICEpdf
  2. PDF-775

Text outline clipping failing if smoothImage scaling enabled.

    Details

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

      Description

      The file in question is using text outline clipping as a mask to an image. If -Dorg.icepdf.core.imageReference=smoothScaled is used the clip is incorrectly applied. This can be avoided with -Dorg.icepdf.core.imageReference=default but this will adversely affect other images.

      We'll need to pass in a custom flag when applying outline clipping to avoid image scaling .

        Activity

        Patrick Corless created issue -
        Patrick Corless made changes -
        Field Original Value New Value
        Description The file in question is using text outline clipping as a mask to an image. If -Dorg.icepdf.core.imageReference=smoothScaled is used the clip is incorrectly applied. This can be avoided with -Dorg.icepdf.core.imageReference=default but this will adversely affect other images.

        We'll need tot pass in a custom flag when applying outline clipping to avoid image scaling.
        The file in question is using text outline clipping as a mask to an image. If -Dorg.icepdf.core.imageReference=smoothScaled is used the clip is incorrectly applied. This can be avoided with -Dorg.icepdf.core.imageReference=default but this will adversely affect other images.

        We'll need to pass in a custom flag when applying outline clipping to avoid image scaling .
        Patrick Corless made changes -
        Attachment Chicago_Guide_Updated1.pdf [ 17265 ]
        Arran Mccullough made changes -
        Support Case References Support Case #12907 - https://icesoft.my.salesforce.com/5007000000dugM6
        Patrick Corless made changes -
        Fix Version/s 5.1 [ 10675 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #42104 Wed Aug 13 14:43:12 MDT 2014 patrick.corless PDF-775 fixed an issue where the image dimensions aren't update even know a masking based scale has taken place.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/SmoothScaledImageReference.java
        Hide
        Patrick Corless added a comment -

        What appears to be happening here is that the black text is actually a 2x2 image that has a large image smask like 220x25. The reason the masking goes wrong is that the the trilinear smooth scaling operation does the math on a 2x2 images and not the resized 220x25.

        Once this change is made the image is no longer scaled and smoothed slightly by the trilenear scaling.

        Show
        Patrick Corless added a comment - What appears to be happening here is that the black text is actually a 2x2 image that has a large image smask like 220x25. The reason the masking goes wrong is that the the trilinear smooth scaling operation does the math on a 2x2 images and not the resized 220x25. Once this change is made the image is no longer scaled and smoothed slightly by the trilenear scaling.
        Hide
        Patrick Corless added a comment -

        Marking as fixed.

        Show
        Patrick Corless added a comment - Marking as fixed.
        Patrick Corless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #42130 Wed Aug 20 14:20:25 MDT 2014 patrick.corless PDF-775 fixed an issue where the image dimensions aren't updated due to image mask scaling.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/ScaledImageReference.java
        Hide
        Patrick Corless added a comment -

        An oversight on our part as the client is actually using the scaledImageReference and not the smoothScaledImageReference implementation. The scaledImageReferenced also suffered from the the sizing issue between the actual image and the image raster. scaledImageReference was reworked to calculate the image dimensions based on the new image that resulted from the image decode and not the image dimensions that are define in the image's dictionary.

        For example a black images has a dictionary dimension of 2x2 and a masking image for example that is 300x120. After the decode the original 2x2 image has been scaled to the 300x120 so the masking could be properly applied. Now when the scaledImageReference scaling takes place 300x120 is used instead of erroneous 2x2 size.

        Show
        Patrick Corless added a comment - An oversight on our part as the client is actually using the scaledImageReference and not the smoothScaledImageReference implementation. The scaledImageReferenced also suffered from the the sizing issue between the actual image and the image raster. scaledImageReference was reworked to calculate the image dimensions based on the new image that resulted from the image decode and not the image dimensions that are define in the image's dictionary. For example a black images has a dictionary dimension of 2x2 and a masking image for example that is 300x120. After the decode the original 2x2 image has been scaled to the 300x120 so the masking could be properly applied. Now when the scaledImageReference scaling takes place 300x120 is used instead of erroneous 2x2 size.
        Patrick Corless made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: