ICEpdf
  1. ICEpdf
  2. PDF-1091

Out of memory exception when applying smask on large images.

    Details

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

      Description

      The file in question has an interesting gradient effect for the background which is composed of two very large images (4k x 4k). With a 2GB heap we can decode these two images but when we create the resultant image we blow the stack.

      We should be able to get around this issue but not creating the resultant issue or down scaling the images earlier on during the render cycle.

        Activity

        Patrick Corless created issue -
        Arran Mccullough made changes -
        Field Original Value New Value
        Support Case References Support Case #13980 - https://icesoft.my.salesforce.com/5007000001gNswe
        Hide
        Patrick Corless added a comment -

        Iv'e been able to significant reduce the amount of memory needed to apply the masking image by making sure we reuse the base image when an alpha channel is available. Attempts to scale the image size failed as the the image was drawn in the incorrect location as a result. Significant work would be needed to pass along the scale information to offset the original scale. We will definitely keep this idea for later.

        PDF does render without error with -Xmx1024m but this PDF also ues a type4 mesh shading pattern which we currently don't support. I'm going to take a shot at parsing the patter type and see if we can't support the generated colours at some level.

        Show
        Patrick Corless added a comment - Iv'e been able to significant reduce the amount of memory needed to apply the masking image by making sure we reuse the base image when an alpha channel is available. Attempts to scale the image size failed as the the image was drawn in the incorrect location as a result. Significant work would be needed to pass along the scale information to offset the original scale. We will definitely keep this idea for later. PDF does render without error with -Xmx1024m but this PDF also ues a type4 mesh shading pattern which we currently don't support. I'm going to take a shot at parsing the patter type and see if we can't support the generated colours at some level.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #49788 Thu Jan 05 14:29:04 MST 2017 patrick.corless PDF-1091 addition of Shadding pattern types 4-7, supporting basic parsing and colour extraction.
        Files Changed
        Commit graph ADD /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/ShadingMeshPattern.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/ShadingPattern.java
        Commit graph ADD /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/ShadingType7Pattern.java
        Commit graph ADD /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/ShadingType5Pattern.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/Resources.java
        Commit graph ADD /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/ShadingType6Pattern.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/io/BitStream.java
        Commit graph ADD /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/ShadingType4Pattern.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/ShadingType1Pattern.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/ShadingType3Pattern.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/ShadingType2Pattern.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #49789 Thu Jan 05 14:29:21 MST 2017 patrick.corless PDF-1091 addition of Shadding pattern types 4-7, supporting basic parsing and colour extraction.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-6.1.0/icepdf/core/src/org/icepdf/core/pobjects/graphics/ShadingType1Pattern.java
        Commit graph MODIFY /icepdf/branches/icepdf-6.1.0/icepdf/core/src/org/icepdf/core/io/BitStream.java
        Commit graph ADD /icepdf/branches/icepdf-6.1.0/icepdf/core/src/org/icepdf/core/pobjects/graphics/ShadingType6Pattern.java
        Commit graph ADD /icepdf/branches/icepdf-6.1.0/icepdf/core/src/org/icepdf/core/pobjects/graphics/ShadingType5Pattern.java
        Commit graph MODIFY /icepdf/branches/icepdf-6.1.0/icepdf/core/src/org/icepdf/core/pobjects/graphics/ShadingPattern.java
        Commit graph ADD /icepdf/branches/icepdf-6.1.0/icepdf/core/src/org/icepdf/core/pobjects/graphics/ShadingType7Pattern.java
        Commit graph MODIFY /icepdf/branches/icepdf-6.1.0/icepdf/core/src/org/icepdf/core/pobjects/graphics/ShadingType3Pattern.java
        Commit graph ADD /icepdf/branches/icepdf-6.1.0/icepdf/core/src/org/icepdf/core/pobjects/graphics/ShadingMeshPattern.java
        Commit graph ADD /icepdf/branches/icepdf-6.1.0/icepdf/core/src/org/icepdf/core/pobjects/graphics/ShadingType4Pattern.java
        Commit graph MODIFY /icepdf/branches/icepdf-6.1.0/icepdf/core/src/org/icepdf/core/pobjects/graphics/ShadingType2Pattern.java
        Commit graph MODIFY /icepdf/branches/icepdf-6.1.0/icepdf/core/src/org/icepdf/core/pobjects/Resources.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #49800 Fri Jan 06 14:10:49 MST 2017 patrick.corless PDF-1091 minimized the need to create a new buffer if an image already has alpha values when building out masking and blending effects.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-6.1.0/icepdf/core/src/org/icepdf/core/pobjects/ImageUtility.java
        Commit graph MODIFY /icepdf/branches/icepdf-6.1.0/icepdf/core/src/org/icepdf/core/pobjects/graphics/commands/FormDrawCmd.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #49801 Fri Jan 06 14:11:03 MST 2017 patrick.corless PDF-1091 minimized the need to create a new buffer if an image already has alpha values when building out masking and blending effects.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/ImageUtility.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/commands/FormDrawCmd.java
        Patrick Corless made changes -
        Fix Version/s 6.2 [ 13090 ]
        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 #49982 Wed Jan 11 08:41:43 MST 2017 patrick.corless PDF-1091 fixed regression with lzw decode and bit packing of length 9. Adjustments are made for 32 bit reads only.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-6.1.0/icepdf/core/src/org/icepdf/core/io/BitStream.java
        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: