commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Grogan" <>
Subject Re: [FileUpload] Resizing JPEG before upload
Date Thu, 02 Jun 2005 10:37:35 GMT
Hi Stefan,
Thanks for your quick reply. I have tried to integrate the code on that 
site, but without much luck. I have the following fragment as an example. I 
must admint, my knowledge of AWT and SWING are not good.
                    File uploadedFile = new File("output.jpg");
                    ImageIcon myImageIcon = new ImageIcon(item.get());    // 
get byts in file item
                    myImageIcon = resizeImage( myImageIcon, 150, 100);    // 
i need to scale the image to max 150x100 pixels
                    //  need now to convert myImageIcon back to a JPEG of 
size 150x100, but don't know where to start with this.
                    // newitem should be a byte[] ? that has been re-encoded 
to JPEG?
                    catch(Exception e){out.println("Problem uploading 
This is probably all wrong, and not the way to go about things, but I'm 
coding in the dark on this one.
Many thanks,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message