[IMAGE-SIG] Problem with PIL 0.3a1 and Grail

Fredrik Lundh fredrik.lundh@image.combitech.se
Fri, 8 Aug 1997 09:59:37 +0200


>I don't know if this has been reported before, but in my PC the new PIL 
>release seems to crash my copy of Grail 0.3 final. I think the problem 
>is in the module AsyncImage.py of the Grail distribution, which tries to 
>find out if PIL is available and works with Tk, creating an PhotoImage.

The problem is more intricate than that; the AsyncImage module
inherits from the ImageTk PhotoImage class, without calling it's
constructor. Since the inner workings of the class was changed,
Grail no longer set things up correctly, and the ImageTk module
then raised an exception when called from _tkinter. Unfortunately,
_tkinter wasn't prepared to handle that situation...

Here's a quick fix:

In AsyncImage.py, in the PILAsyncImage constructor, change:

    self._PhotoImage__tk = self.image

to

    self._PhotoImage__photo = self.image

(you could simply add the second line just after the first one; should
make it work with both versions of PIL).

I started working on a better solution, but got distracted by more
urgent stuff :-(

Cheers /F

fredrik@pythonware.com
http://www.pythonware.com




_______________
IMAGE-SIG - SIG on Image Processing with Python

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