Image width, height.

Premshree Pillai premshree_python at yahoo.co.in
Sat Mar 6 10:57:15 EST 2004


 --- Bob Ippolito <bob at redivi.com> wrote: > On
2004-03-01 06:38:11 -0500, Premshree Pillai 
> <premshree_python at yahoo.co.in> said:
> 
> > Hello,
> > 
> > Is there a Py module available using which I can
> find
> > the width and height of any image format?
> 
> ANY image format is a tall order, however PIL is
> pretty good at it, and 
> supports a large number of image formats.
> 
> >>> import Image
> >>> Image.open('testorig.jpg').size
> (227, 149)
> 
> Note that even if you don't have a JPEG decoder
> available, PIL bakes in 
> enough support for the format to let you get the
> image dimensions out 
> of the header.  I'd imagine that this is generally
> true with the rest 
> of PIL, too.
> 
> -bob
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list 

Worked like a charm. Thanks! Updated version of
pyAlbum.py at
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/271246

-Premshree Pillai

=====
-Premshree
[http://www.qiksearch.com/]

________________________________________________________________________
Yahoo! India Insurance Special: Be informed on the best policies, services, tools and more. 
Go to: http://in.insurance.yahoo.com/licspecial/index.html




More information about the Python-list mailing list