Reading image dimensions

Hello,

I’m wondering what is the fastest computational way to get the dimensions of a image on a local disk? I don’t want to load the image into memory, not unless I really need to…

any ideas?

Reading the header… the info is there. (The header is as the name suggests at the very beginning of a file.)

I think ImageIO can do this… that is get image metadata without decoding the full image. Check the docs.

thanks guys.