in reply to How can I get image height and width without using Image::Size?

There are several other modules other than Image::Size that you can use to get the height and width of an image. You could try Image::Info or Image::Magick.

But if you want to avoid using modules entirely you're going to have to learn how to read image headers. The headers are different for different types of images (.jpg, .png, etc...). But in general most image files have the height and width stored (generally as 16 or 32 bit integers) somewhere within the first 100 bytes or so of the image.

  • Comment on Re: How can I get image height and width without using Image::Size?