I have some code that scales images. It is based on code from “Filthy Rich Clients”. It runs great on Windows/Linux and Mac OS X 10.4. However, on Leopard (10.5) it slows down significantly. I have narrowed it down to the following code snippet:
BufferedImage tmp = new BufferedImage( w, h, type );
Graphics2D g2 = tmp.createGraphics();
if( hint != null )
{
g2.setRenderingHint( RenderingHints.KEY_INTERPOLATION, hint );
}
g2.drawImage( ret, 0, 0, w, h, null );
g2.dispose();
The call to drawImage() takes about 400ms. to complete. The initial image is 2048x3072 and the target is 50x72.
When I run the exact same code with the exact same image on Leopard, the drawImage() call takes over 2 MINUTES to complete.
Anybody have any suggestions?
Thanks,
Steve