[Image-SIG] problems with Image.crop

Fredrik Lundh fredrik@pythonware.com
Wed, 9 Jun 1999 16:07:12 +0200


> It seems that I get a few nagging problems when using the Image.crop function:
> 
> If I do a crop function on an Image object, I very frequently get AttributeErrors
> afterwards when I try to perform other methods (such as Image.convert).  These
> AttributeErrors are always related to palette and info (palette stops it in its
> tracks first).

what version are you using.  this bug was fixed
back in 0.3a4 (March 98).

the problem was that the _ImageCrop constructor
didn't call Image's __init__ method, which left some
attributes uninitialized.

> Traceback (innermost last):
>   File "<interactive input>", line 0, in ?
>   File "D:\Python\Fusion_Analyzer_200Beta_allfiles\Unzipped Fusion Analyzer
> 2.00BETA\lib\imaging\Image.py", line 327, in convert
>     return self._makeself(im)
>   File "D:\Python\Fusion_Analyzer_200Beta_allfiles\Unzipped Fusion Analyzer
> 2.00BETA\lib\imaging\Image.py", line 223, in _makeself
>     new.palette = self.palette
> AttributeError: palette

fwiw, those line numbers don't seem to match 1.0b1
(too much work to figure out which one, though).

</F>