[Image-SIG] PIL 1.0b1 and GifImagePlugin.py

Daniel Walton image_sig@opti.okdirect.com
Thu, 11 Mar 1999 05:31:20 -0600

Looks like it worked for me!  Thanks Steve!


At 02:46 PM 3/8/99 +0000, you wrote:
>Re: Daniel Walton's reported error with local/global palettes in GIF
>images, namely:
>	File "/usr/local/lib/python1.5/site-packages/PIL/GifImagePlugin.py",
>	109, in seek
>	    self.palette = self.global_palette
>	AttributeError: global_palette
>I have also experienced this error for the first time today, and have a
>patch to offer.  It seems to work for his sample image and those with
>global palettes, but I didn't test exhaustively (with, for example,
>animated GIFs).  The innocuous patch is to insert the following at line
>78 of 'GifImagePlugin.py':
>	else:
>	    self.global_palette = None
>as a counterpart to the 'if' on line 73:
>	if flags & 128:
>Works for me.  Hope this helps Daniel and/or others somehow.
>BTW, a ready source of these local-palette images is the GIF encoder
>built into the MS Office 2000 preview.  These images also confuse the
>well-known 'xv' viewer, so PIL is in somewhat illustrious company on
>this issue.
>Steve Purcell            |  Stunt Programmer  &
>steve@websentric.com     |  Software Design Engineer
>Image-SIG maillist  -  Image-SIG@python.org