[Image-SIG] JPG and ImageDraw
Juha Ylitalo
juha.o.ylitalo@nokia.com
Sun, 1 Oct 2000 00:36:04 +0300
--PNTmBPCT7hxwcZjr
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
xpcd)
Code:
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=
ne
ink, fill =3D self._getink(fill)
File "/usr/lib/python1.5/site-packages/PIL/ImageDraw.py", line 73, in _ge=
tink
ink =3D self.im.draw_ink(ink)
TypeError: illegal argument type for built-in operation
bash-2.04$=20
--
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."
--PNTmBPCT7hxwcZjr
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.3 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE51lzDs9o7tOc1jEMRAvexAJ9lxkD02/H3YX9bGlsYkFa5TQo0QACeLvBV
F8G2Oa0aXLsv0lo1GtqfrI0=
=vKDz
-----END PGP SIGNATURE-----
--PNTmBPCT7hxwcZjr--