GIF Image Size

Rindolf rindolf2 at yahoo.comNOSPAM
Tue Jan 2 21:37:28 EST 2001


"Greg Landrum" <glandrum at my-deja.com> wrote in message
news:92tbig$ede$1 at nnrp1.deja.com...
> In article <Wxp46.24381$F_3.940941 at newsread2.prod.itd.earthlink.net>,
>   "Rindolf" <rindolf2 at yahoo.comNOSPAM> wrote:
> > Is there any way to find out the dimensions of a GIF image using
> python? I
> > looked in the language reference and it didn't look like there was.
> >
>
> If you are going to be working with GIFs (or any image format for that
> matter), you probably want to install PIL:
> http://www.pythonware.com/products/pil/index.htm
> Once you have that installed, you can easily determine the size of a GIF
> as follows:
> from Pil import Image
> img = Image.open('foo.gif')
> print img.size
>
> I hope this helps,
Thank you! Btw, what type of object is img.size, and what is the class of
object returned by Image.open()?

Rindolf





More information about the Python-list mailing list