[Image-SIG] problem with PIDDLE and PIL

Piers Lauder piers@cs.su.oz.au
Fri, 04 Feb 2000 21:03:31 +1100

When installing PIDDLE and running its built-in test suite, I encountered
an error Traceback from within PIL (VERSION=1.0):

	# s piddle ; python piddletest.py
		   1. piddleAI                     A. minimal          
		   2. piddleGL                     B. basics           
		   3. piddlePDF                    C. advanced         
		   4. piddlePIL                    D. spectrum         
		   5. piddlePS                     E. strings          
		   6. piddleQD                     F. rotstring        
		   7. piddleTK                                         
		   8. piddleVCR                                        

	Selection (0 to exit): 4A


	This module implements a Python Imaging Library PIDDLE canvas.
	In other words, this is a PIDDLE backend that renders into a
	PIL Image object.  From there, you can save as GIF, plot into
	another PIDDLE canvas, etc.

	Joe Strout (joe@strout.net), 10/26/99

	Just a very basic test of line drawing and canvas size.

	Traceback (innermost last):
	  File "piddletest.py", line 273, in ?
	  File "piddletest.py", line 268, in mainLoop
	    runtest(backends[backend], tests[test])
	  File "piddletest.py", line 210, in runtest
	    canvas = testfunc(canvasClass)
	  File "piddletest.py", line 22, in minimal
	  File "piddlePIL.py", line 247, in drawLine
	    self._pen.line( (x1,y1), (x2,y2) )
	  File "/local/usr/lib/python1.5/site-packages/PIL/ImageDraw.py", line 107, in line
	    ink, fill = self._getink(fill)
	  File "/local/usr/lib/python1.5/site-packages/PIL/ImageDraw.py", line 73, in _getink
	    ink = self.im.draw_ink(ink)
	TypeError: illegal argument type for built-in operation

Looking at the source involved, _getink is defined as:
	def _getink(self, ink, fill=None):

but there are calls to _getink of the form (lines 106,107):
	def line(self, xy, fill=None):
            ink, fill = self._getink(fill)

I may well be wrong - but shouldn't line 107 read:
	    ink, fill = self._getink(fill=fill)

If I'm way off beam here, I'd be very grateful for pointers on
where else to look...

Piers Lauder.