[IMAGE-SIG] Re: split() problem?

Skip Montanaro skip@calendar.com (Skip Montanaro)
Sun, 8 Mar 1998 17:07:30 -0500 (EST)


I was getting a traceback:

    exceptions.AttributeError, palette
    ...
    /usr/local/lib/python1.5/Imaging/Lib/Image.py:541 in split
	ims.append(self._makeself(self.im.getband(i)))
    /usr/local/lib/python1.5/Imaging/Lib/Image.py:219 in _makeself
	new.palette = self.palette

Upgrading to 0.3a3 didn't help.  The object being split turned out to be an
Image._ImageCrop instance, which is a subclass of Image.Image.  The
_ImageCrop __init__ method doesn't call the Image __init__ method, so it's
missing a number of instance variables.  Adding

    Image.__init__(self)

as the first line of Image._ImageCrop.__init__ seems to solve the problem.

Skip Montanaro    | Musi-Cal: http://concerts.calendar.com/
skip@calendar.com | Python Support: http://www.pythonpros.com/
(518)372-5583     | XEmacs: http://www.automatrix.com/~skip/xemacs/tip.html


_______________
IMAGE-SIG - SIG on Image Processing with Python

send messages to: image-sig@python.org
administrivia to: image-sig-request@python.org
_______________