getting size of gif

Bill Rubenstein wsr2 at swbell.net
Tue Mar 9 18:22:18 EST 2004


In article <104se8bhc5rm477 at corp.supernews.com>, claird at lairds.com says...
> In article <9L2dna_mgLuovNPd4p2dnA at comcast.com>,
> Larry Bates <lbates at swamisoft.com> wrote:
> >Get PIL (Python Imaging Library) if you don't already have it
> >
> >http://www.pythonware.com/products/pil/index.htm/
> >
> >import Image
> >pathtogif=r'C:\xxx.gif'   # Replace with your path
> >im=Image.open(pathtogif)
> >x,y=im.size
> >im.close()
> 			.
> 			.
> 			.
> It doesn't require all of PIL, though, for those who
> have a reason *not* to rely on it; it just takes a couple
> of byte-twiddles.  <URL: http://wiki.tcl.tk/758 > can
> easily be translated into pure Python.
> 

Another source: http://www.onicos.com/staff/iz/formats/gif.html and a little 
messing with the struct module should get you there.

Bill




More information about the Python-list mailing list