[PYTHON IMAGE-SIG] Newbie: lena.jpg fails to load
Ken Whedbee
whedbee@ddi.digital.net
26 Mar 1997 20:43:33 -0500
Ken Whedbee <whedbee@digital.net> writes:
> I'm getting a failure trying to load "lena.jpg" and would like some
> pointers in resolving this. I can get "lena.gif" to load correctly.
> However, when I try "lena.jpg" I get:
>
> Python 1.4 (Nov 17 1996) [GCC 2.6.3]
> Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
> >>> import Image
> >>> im = Image.open('lena.jpg')
> >>> im.resize((500, 500))
> Traceback (innermost last):
> File "<stdin>", line 1, in ?
> File "/local/lib/python1.4/Imaging/Lib/Image.py", line 321, in resize
> self.load()
> File "/local/lib/python1.4/Imaging/Lib/ImageFile.py", line 148, in load
> d = _getdecoder(d, e, a, self.decoderconfig)
> File "/local/lib/python1.4/Imaging/Lib/ImageFile.py", line 49, in _getdecoder
> raise IOError, "decoder %s not available" % d
> IOError: decoder jpeg not available
> >>>
Ok - I'll answer my own question. I found out you have to have
-DHAVE_LIBJPEG in the DEFS= line in the Imaging/Makefile and in the
Imaging/libImaging/Makefile. Too bad the "Setup" file doesn't handle
this automatically for you.
--
Ken Whedbee
mailto:whedbee@ddi.digital.net
_______________
IMAGE-SIG - SIG on Image Processing with Python
send messages to: image-sig@python.org
administrivia to: image-sig-request@python.org
_______________