Image width, height.

Nelson Minar nelson at monkey.org
Mon Mar 1 11:04:07 EST 2004


Premshree Pillai <premshree_python at yahoo.co.in> writes:
> Is there a Py module available using which I can find
> the width and height of any image format?

I'm not aware of one short of loading the whole image or shelling out
to another tool.

There's a nifty Perl module though:
  http://www.blackperl.com/Image::Size/
The nice thing about it is it doesn't have to load the whole image in
most cases. The actual size determining code is about 500 lines of
fairly simple Perl to handle about 10 image formats. It might not be
too bad to port it. It's under the Perl Artistic License.



More information about the Python-list mailing list