开发者

Efficient way to generate fixed size thumbnails for large size images?

开发者 https://www.devze.com 2023-01-13 05:48 出处:网络
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

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消