getting size of gif

Larry Bates lbates at swamisoft.com
Tue Mar 9 14:55:37 EST 2004


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()

-Larry



"biner" <biner.sebastien at ouranos.ca> wrote in message
news:b82e5469.0403091126.33d0afe7 at posting.google.com...
> Hello all,
>
>   I would like to know if there is a module out there to help me get
> the size of a gif image. The idea is to verify that the size is not
> greater than a certain value before forcing it toward a given
> dimension in a web page.
>
>   Also, is there any way to know which function is used if we use two
> module that define the same function with the same name and arguments.
> E.g. the join function is present in the string module and the os.path
> module with string as input and output. Is there a way to force Python
> to tell me of the possible conflict?
>
> Thanks in advance.
>
> Ciao!
> Sebastien Biner.
> biner.sebastien at ouranos.ca





More information about the Python-list mailing list