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 Code to create thumbnails 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 "Code to create thumbnails" Watch "Code to create thumbnails" New topic
Author

Code to create thumbnails

Paul Anavian
Greenhorn

Joined: Mar 12, 2002
Posts: 2
I am trying to figure out how to write code that will create a thumbnail of an existing uploaded image. I know how to make a thumbnail manually, what I need is code to generate thumbnails as soon as a user uploads an image via a form. Please Help!!!
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
Anavian,
Javaranch has a naming policy which is strictly enforced. Please change your display name to conform with this policy if you wish to keep posting here. Thanks.


Matthew Phillips
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
You can call external programs to generate the thumbnails from the java.lang.Runtime API.
One good image handling package is imagemagick (www.imagemagick.org)
Imagemagick also has a JNI based Java API (http://www.yeo.nu:81/jmagick/)


Seam Framework: http://www.amazon.com/exec/obidos/ASIN/0137129394/mobileenterpr-20/
Ringful: http://www.ringful.com/
Prashanth menon
Ranch Hand

Joined: Feb 20, 2001
Posts: 65
Originally posted by Anavian:
I am trying to figure out how to write code that will create a thumbnail of an existing uploaded image. I know how to make a thumbnail manually, what I need is code to generate thumbnails as soon as a user uploads an image via a form. Please Help!!!

hi
It is the same as manual method. Only that the image here will be dynamically loaded. We can write a servlet that returns an image after reading it in a particular image format.
classes From Graphics2D or JavaAdvancedImaging API would help serve the purpose
There are also lots of other imagedecoder classes available
prashanth
Paul Anavian
Greenhorn

Joined: Mar 12, 2002
Posts: 2
Thanks for the info I'll check it and let you know how it turns out.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Code to create thumbnails
 
Similar Threads
image dimension
Confused about Server Paths
How will i make a servlet to generate jsp page dynamically
How to generate thumbnail of word/excel document
ImageIcon problems and X11 -- Part 2....