cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Williams <william...@gmail.com>
Subject Extending the image reader
Date Sun, 29 Jan 2006 23:02:45 GMT
I want the image reader to accept a variant name (e.g. "thumb",
"small") and then write the newly created image variant to disk before
sending the output.  In other words, so that a given image
"IMG001.jpg" might be "read" with a variant "thumb" and on disk would
now be:
IMG001.jpg
IMG001.thumb.jpg

Obviously, a hefty cost for the first time through on each image but
just reading afterwards.  I've initially done this by just copying the
entire ImageReader into a new PersistentImageReader and inserting the
applicable code in setup() and processStream().  Now that it's working
how I'd like, I figured I'd just extend the ImageReader and only
implement these two methods.  The only way I can think to do it is
somehow redirect the output into a buffer, write the buffer, then send
it out.  Is there a better way to extend a reader?  Anyone have any
clues as to how I might be able to buffer the ImageReader's output?

Thanks,
--tim

Mime
View raw message