cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 36466] - ImageReader problem with grayScaleFilter
Date Tue, 20 Sep 2005 11:02:08 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36466>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36466





------- Additional Comments From vbilan@tssg.org  2005-09-20 13:02 -------
Actually you don't need to reproduce that problem it visible through the code 
of ImageReader.java: 
 
If you specify only one instance of that class in the pool, you will always 
return to the same instance of that class, amt I correct? 
 
So, if that instance get ones grayscale parameter set to true it will initiate 
filter, after that it doesn't matter what the request parameter value is set. 
The grayscaleFilter won't be null. 
 
setup(): 
if (par.getParameterAsBoolean("grayscale", GRAYSCALE_DEFAULT)) { 
 this.grayscaleFilter = new 
ColorConvertOp(ColorSpace.getInstance(ColorSpace.CS_GRAY), null); 
} 
 
if you look at getKey method you check for this.grayscaleFilter == null, but 
won't be null after the first request of crayscale image. 
 
public Serializable getKey() { 
        return this.inputSource.getURI() 
...skip some code 
                + ":" + ((null == this.grayscaleFilter) ? "color" : 
"grayscale") 
                + ":" + super.getKey(); 
    } 
 
Solution is very simple: 
1. use request parameter to create getKey and in process method and create a 
static grayscaleFilter; 
2. or set it to null/value every time you check for request parameter 
'grayscale'. 
 

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Mime
View raw message