Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-4411

Support caching of ICC based color spaces

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.13
    • 2.0.14, 3.0.0 PDFBox
    • Rendering
    • None
    • Patch

    Description

      Following up on PDFBOX-4392 I have noticed ICC color spaces aren't being cached in the resource cache, since they are represented not by a `COSObject` but rather by a `COSArray` with `COSName` of `ICCBased` as the first element and a `COSObject` (the actual profile) as the second element.  

      This patch introduces a static `create` method to `PDICCBased` which optionally caches/retrieves the color space from cache. Accordingly, the constructor taking a `COSArray` has been made private, and the validity tests moved to the static `create` method.   

      Testing on the example from PDFBOX-4392 the patch improves both time and memory consumption. Presumably it will help with any PDF with ICC-based profiles which are re-used by many images. 

      Attachments

        1. gs-bugzilla690425-veryslow.pdf
          3.17 MB
          Tilman Hausherr
        2. Cache_PDICCBased_color_spaces.patch
          4 kB
          Itai Shaked

        Activity

          People

            tilman Tilman Hausherr
            itai Itai Shaked
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: