Uploaded image for project: 'Cocoon'
  1. Cocoon
  2. COCOON-1589

ImageReader problem with grayScaleFilter

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.7
    • None
    • - Components: Sitemap
    • None
    • Operating System: Linux
      Platform: PC
    • 36466

    Description

      SiteMap:
      <map:reader logger="sitemap.reader.image" name="jpg-reader"
      src="org.apache.cocoon.reading.ImageReader"/>

      <map:match pattern="**/*.jpg">
        <map:read type="jpg-reader" mime-type="image/jpg" src="image/{1}/{2}.jpg">
          <map:parameter name="expires" value="-1"/>
        </map:read>
      </map:match>

      I did not specify pool-max. The default value is set to 1, is it?
      Becouse it always refers to the same instance

      .../jpeg/image.jpg?widht=100
      pipeline works fine until you specify parameter grayscale and set to true
      .../jpeg/image.jpg?width=100&grayscale=true - works fine
      but after that you can't create not grayscale image
      .../jpeg/image.jpg?width=200&grayscale=false you will get grayscale image any
      way, Because:
      in Setup method you set this.grayscaleFilter

       if (par.getParameterAsBoolean("grayscale", GRAYSCALE_DEFAULT)) {
        this.grayscaleFilter = new
      ColorConvertOp(ColorSpace.getInstance(ColorSpace.CS_GRAY), null);
        }

      and never set to null, so when the pool of that ImageReader will be full of
      instances with grayscaleFilter set it wont be possible to get original image

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users

          People

            Unassigned Unassigned
            vbilan@tssg.org Vadim Bilan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment