Image width, height.
Afonso Fernández Nogueira
fonso at aturuxo.net
Mon Mar 1 11:26:55 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.
The PIL does this, too.
http://www.pythonware.com/products/pil/
cheers,
Fonso
More information about the Python-list
mailing list