[Image-SIG] JPG and ImageDraw

Juha Ylitalo juha.o.ylitalo@nokia.com
Sun, 1 Oct 2000 00:36:04 +0300

Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

This might be basic question for all those, who have been playing with
ImageDraw in past, but I've just started to do experimenting on it and
ran into problems.
I am trying to create system that would read JPG file in, draw
rectangle on it and write the JPG file back with the same name. After
my initial trials kept on failing, I went to handbook example and
tried that one and it still keeps on failing. I've started to wonder
if I am trying to do something that is not supported with JPG files or
something ? All advices are appreciated.

Here is technical description of the problem:
Operating System: Debian GNU/Linux Woody
Python: 1.5.2
Python-Imaging: 1.1-2 (according to Debian package)
Images: Images are 3072x2048 JPG files, which have been created with=20
        external program (application is pcdtoppm and it comes with=20

     image =3D Image.open( newname )
     draw =3D ImageDraw.ImageDraw( image )
     draw.setink( 128 )
     """ draw.rectangle( self.box, outline=3D128 ) """
     draw.line( (0,0), image.size )
     draw.line( (0, image.size[ 1 ] ), (image.size[ 0 ],0))
     image.save( newname )

Error Message:

bash-2.04$ python photos.py ~/public_html/photos/shows/usenix2000.cf
Traceback (innermost last):
  File "photos.py", line 338, in ?
  File "photos.py", line 82, in __init__
  File "photos.py", line 104, in make_photolist
  File "photos.py", line 183, in __init__
  File "photocd.py", line 72, in convert
  File "/usr/lib/python1.5/site-packages/PIL/ImageDraw.py", line 107, in li=
    ink, fill =3D self._getink(fill)
  File "/usr/lib/python1.5/site-packages/PIL/ImageDraw.py", line 73, in _ge=
    ink =3D self.im.draw_ink(ink)
TypeError: illegal argument type for built-in operation

Juha Ylitalo     juha.o.ylitalo@nokia.com                <work e-mail>
KOM 5/3 312      http://wwwinhel.ntc.nokia.com/~jylitalo <work www>
+358 40 562 6152 http://www.iki.fi/~jylitalo             <public www>
"Some tools are used, because its policy, others because they are good."
Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.0.3 (GNU/Linux)
Comment: For info see http://www.gnupg.org