This is pretty out of scope for this mailing list, but here are some brief thoughts:
I know of no simple solution - I expect that the performance of Image IO is going to be insufficient. I suggest you look at JAI (java advanced imaging) and native solutions (JNI, etc.). Your requirements are going to be an important factor in finding a good solution. Do you need these thumbnails written to disk (as image files) or in memory (as, say, BufferedImages)? Are the source images on disk or in memory? How many different file formats do you need to support? Can you depend on native code or JAI? Charles Matthew On Wed, Jul 1, 2009 at 8:33 AM, Mathieu Avoine<[email protected]> wrote: > 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 > >
