Click to See Complete Forum and Search --> : Get image's width and height faster


dunsun
11-15-2005, 04:21 AM
Hi,
I have problem how to get image's width and height (represented by file.jpg) faster.
Using BufferedImage's getWidth() or getHeight() methods is very slow cause I have to read the whole image via ImageIO.read().

Is there a way how to get image's height and width much faster ?

Thank you for your advices.

Oak
11-15-2005, 04:43 AM
Trying using javax.swing.ImageIcon ?

It takes the full file name as a constructor arguement and then has methods:

int getIconHeight()
int getIconWidth()

I am not sure if it will be faster as maybe it performs the same process but at a higher level but I have used this in the past to check if an image is portrait or landscape.

Worth a shot.