Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.7
-
None
-
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
<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