[Image-SIG] Re: Re: PIL Bug: Crash processing GIF image
Fredrik Lundh
fredrik at pythonware.com
Tue Feb 24 14:19:25 EST 2004
> if you want to ignore the logical screen, you can manipulate the "size"
> and "tile" attributes after you've opened the file, but before you've done
> anything else with the image:
>
> i = Image.open(...)
>
> if i.tile[0][0] == "gif":
> # only read the first "local image" from this GIF file
> x0, y0, x1, y1 = i.tile[0][1]
> i.size = x1-x0, y1-y0
> del i.tile[1:]
the above only works if the "local image" is located in the
upper left corner; I've posted an improved version here:
http://effbot.org/zone/pil-format-gif.htm
</F>
More information about the Image-SIG
mailing list