In order to write the images out, you need to use javax.imageio, which is included in recent JDKs and can write to a variety of formats.
I use this combination to accept image uploads, determine their size, store them in a database, and then serve them back at any resolution. I.E, the url for the image may specify the size the image should be scaled to. The system looks in a disk cache to find if the file has already been generated, and if not, generates it using the JDK.
The JDK can read gifs but not write them, which is inconvenient but not the end of the world. In my case, I do use transparent images, but I work around this problem by accepting transparent gifs, and then (at request time) accepting a parameter for the background color onto which the gif will be drawn (in my case the bg is always solid). I then draw the gif onto a java.awt.Graphics that has been filled in with that color, and render the final scaled product as a JPG.
I suspect I could make my life a lot easier by using PNGs but I haven't gotten around to it yet...
-Erik
Thorsten M�ller wrote:
Hi,
slightly off topic but does anybody know an Java open source framework or class library which makes it possible to generate images (gif, jpg, png) on the fly on server side and send them to the client (or store them on the web app context)?
Thanks, Thorsten
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- http://www.spectacle.ca/ The New Online Source for Live Music in Montreal .::514.286.1699::.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
