views:

27

answers:

1

What could be the efficient way to generate fixed size thumbnails for large size images in Java?

I have a multiple directories/sub-directories to scan for image files and generate thumbnails for each image. Can I browse multiple directories at same time and generate thumbnail simultaneously? I'm thinking of having two types of processes:

  1. To scan directories. (Multiple but limited thread count).
  2. To generate thumbnail. (Single thread as image IO could eat too much memory) .

Any suggestions?

+1  A: 

Search on Image Magick. It's a great library for programmatic image manipulation.

I had a website where I simply called the command-line tools (command was "convert"), and passed the desired pixel width x height parameter to generate thumbnails for a directory of images. This is essentially what I did on the backend: http://www.ibm.com/developerworks/linux/library/l-graf/

If you need to do this dynamically, at run time, take a look at http://www.imagemagick.org/script/index.php Looks like they have a package for Java that hooks into the very rich Image Magick API, called JMagick.

warriorpostman
@pure.java, Is this answer helpful?
warriorpostman