How to obtain image size using standard Python class (without using external library)?
I am using Python 2.5. And using the standard classes from Python, I want to determine the image size of a file. I've heard PIL (Python Image Library), but it requires installation to work. How might I obtain an image's size without using any external library, just using Python 2.5's own modules? Note I want to support common image formats, particularly JPG and PNG. Here's a python 3 script that returns a tuple containing an image height and width for .png, .gif and .jpeg without using any external libraries (ie what Kurt McKee referenced above). Should be relatively easy to transfer it to