Not sure about the resize and save (3-4) but the rest i use for ensuring users dont upload any old sizes..


java.io.ByteArrayInputStream; java.awt.image.BufferedImage; javax.imageio.ImageIO;

byte[] image = form.getImage().getFileData();
ByteArrayInputStream  stream = new ByteArrayInputStream(image);
BufferedImage img = ImageIO.read(stream);

BufferedImage has getWidth and getHeight

Perhaps also better not to use getFileData on the formFile, and use the getInputStream method instead as its less heavy..

Mark

On 27 Jul 2004, at 10:28, ron1 wrote:

Hi -
after spending much time wondring through the JAI API I thought maybe one of you guys can help me:
I need a very simple:
1. upload-image (jpg/gif)
2. getProps (size, width)
3. resize
4. save JPG with custom compression.
The upload is done via FormFile, so I have the InputStream - all the rest via Java API - and I have no clue of where to get started :-(
Cheers,
Ron



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to