File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Servlet Uploads and Resizing Images? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet Uploads and Resizing Images?" Watch "Servlet Uploads and Resizing Images?" New topic
Author

Servlet Uploads and Resizing Images?

Theodore Casser
Ranch Hand

Joined: Mar 14, 2001
Posts: 1902

I'm hoping someone can give me some ideas here.
My boss approached me yesterday with an interesting problem. A product we're building for a client as a package of servlets and JSP's is going to involve uploading graphics, but the graphics need to be resized, on upload, to a standard size for use in a template.
Is there anyway to accomplish this in the servlet when it's uploaded? We're not talking something on the output (though I had suggested to her to simply use image-size tags on the JSP page when it is output) but a permanent change to the image as it's uploaded.
Thanks!
------------------
Theodore Jonathan Casser
Sun Certified Programmer for the Java2 Platform


Theodore Jonathan Casser
SCJP/SCSNI/SCBCD/SCWCD/SCDJWS/SCMAD/SCEA/MCTS/MCPD... and so many more letters than you can shake a stick at!
David Freels
Ranch Hand

Joined: Feb 01, 2001
Posts: 102
Try scaling the image and writing it to file. Image has a getScaledInstance method available.
David
Sun Certified Programmer for the Java2 Platform
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet Uploads and Resizing Images?
 
Similar Threads
Preserving the quality of images
Thumbnail creation of the image
Why the jpg image produced by servlet is so poor ?
BufferedImage color model
image not shows full path