Hi all,

I have a question which is not directly related to Sanselan and for that I apologize. However, the question is "imaging related" and I do use Sanselan for reading metadata :)
(by the way, would thumbnail creation fit well as a feature in Sanselan?)

I am developing a photo manager and I have some issues with the creation of thumbnails. It takes a very long time to generate them. I use Java standard stuff (ImageIO) to do a scaled down version of the image this so:

           Image scaledImage =
originalImage.getScaledInstance(clip.width, clip.height, Image.SCALE_SMOOTH);

Then, if the image requires a rotation, I then use Graphics2D.drawImage with an AffineTransform like this:

           AffineTransform transform = new AffineTransform();
           // prepare the rotation transform ...
           thumbnailImage = new BufferedImage(thumbWidth, thumbHeight,
                   BufferedImage.TYPE_INT_RGB);
thumbnailImage.createGraphics().drawImage(scaledImage, transform, null);

This takes a LONG time... I run it on a weak computer so it's understandable to some extent but other imaging softwares prepare thumbnails many times faster so I must be doing something wrong here...

Any ideas or suggestions?
Thanks!

Math

Reply via email to