Help with JPEG support with PIL 1.1.5 and OSX


Jack Wu


I've spent a good majority of my day trying to figure out how to have
PIL 1.1.5 working on my OSX 10.3.9_PPC machine. I'm still stuck and I
have not gotten anywhere. Could somebody please help me...

I've scoured all the documentation, google, and mailing lists to no
avail. I believe the problem may lay in a jpeglib problem with OSX
10.3.9, or a python paths problem.

Here is info on my system (note this is not the default Python version
that comes with OSX):
Python 2.4.1 (#2, Mar 31 2005, 00:05:10)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin

This email is really long, I've seperated the sections with 3-4 lines
of spacing.

Here is my own PIL installation summary, I followed directions in
README. I am using the most recent install package from the PIL
website. I also tried using the default JPEG_ROOT=None and JPEG_ROOT
= "sw/lib", where I was able to locate the jpeglib files.
running install
running build
running build_py
running build_ext
version 1.1.5
platform darwin 2.4.1 (#2, Mar 31 2005, 00:05:10)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1666)]
*** TKINTER support not available
--- JPEG support ok
--- ZLIB (PNG/ZIP) support ok
*** FREETYPE2 support not available
To add a missing option, make sure you have the required
library, and set the corresponding ROOT variable in the script.

To check the build, run the script.
running build_scripts
running install_lib
running install_scripts
changing mode of
/Library/Frameworks/Python.framework/Versions/2.4/bin/ to
changing mode of
/Library/Frameworks/Python.framework/Versions/2.4/bin/ to
changing mode of
/Library/Frameworks/Python.framework/Versions/2.4/bin/ to 755
changing mode of
/Library/Frameworks/Python.framework/Versions/2.4/bin/ to 755
changing mode of
/Library/Frameworks/Python.framework/Versions/2.4/bin/ to
This file was 212KB.

I tried running the self-test and this is my output:
Failure in example: _info("Images/lena.jpg"))
from line #24 of selftest.testimage
Exception raised:
Traceback (most recent call last):
File "./", line 499, in _run_examples_inner
exec compile(source, "<string>", "single") in globs
File "<string>", line 1, in ?
File "./", line 21, in _info
File "PIL/", line 180, in load
d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
File "PIL/", line 328, in _getdecoder
raise IOError("decoder %s not available" % decoder_name)
IOError: decoder jpeg not available
1 items had failures:
1 of 55 in selftest.testimage
***Test Failed*** 1 failures.
*** 1 tests of 55 failed.

I ran "$python -vv -c "import _imaging"" and this was the important output:
import _imaging # dynamically loaded from
This file was 962KB.

The file mentioned above (962KB) was not actually the same
one that I compiled earlier (212KB). So I figured there must be some
problem with my python path. I copied the newly compiled version into
the python PIL directory above and tried again. Same problem on self

I then tried the Darwin ports py-pil (
This is the output that I got when installing:
sudo port install py-pil
---> Fetching freetype
---> Attempting to fetch freetype-2.1.10.tar.bz2 from
---> Verifying checksum(s) for freetype
---> Extracting freetype
---> Applying patches to freetype
---> Configuring freetype
---> Building freetype with target all
---> Staging freetype into destroot
---> Packaging tgz archive for freetype 2.1.10_1
---> Installing freetype 2.1.10_1
---> Activating freetype 2.1.10_1
---> Cleaning freetype
---> Fetching jpeg
---> Attempting to fetch jpegsrc.v6b.tar.gz from
---> Verifying checksum(s) for jpeg
---> Extracting jpeg
---> Applying patches to jpeg
---> Configuring jpeg
---> Building jpeg with target all
---> Staging jpeg into destroot
---> Packaging tgz archive for jpeg 6b_1
---> Installing jpeg 6b_1
---> Activating jpeg 6b_1
---> Cleaning jpeg
---> Fetching py-pil
---> Attempting to fetch Imaging-1.1.5.tar.gz from
---> Verifying checksum(s) for py-pil
---> Extracting py-pil
---> Applying patches to py-pil
---> Configuring py-pil
---> Building py-pil with target build
---> Staging py-pil into destroot
---> Packaging tgz archive for py-pil 1.1.5_1
---> Installing py-pil 1.1.5_1
---> Activating py-pil 1.1.5_1
---> Cleaning py-pil
This created a file which was 684KB.

I copied this newly created file into my appropriate
python PIL directory and ran self-test again, and it still had the
same error.

Another test I did was to remove completely from the PIL
directory in Python. When I ran (python -vv -c "import _imaging"),
this was the output:
Traceback (most recent call last):
File "<string>", line 1, in ?
ImportError: No module named _imaging
But still had the same output as before (JPEG decode error).

I also downloaded jpeglib(jpeg-6b) and built it myself (succesfully),
and passed the lib directory for JPEG_ROOT in the PIL installer, but
that didn't have any different self-test results.

It is also very strange that i can set the JPEG_ROOT to be anything,
even something ficticious and the installer will report 'no support
errors' for JPEG.

Another strange thing is a discprency in JPEG libraries, py-pil seems
to use JPEG while PIL seems to reference only LIBJPEG.

Running a search on my HD for turns up 4 sources:
1) /opt/local/lib/python2.4/site-package/PIL/ (684KB - this
was generated by the py-pil install)
2) /opt/local/var/db/dports/software/py-pil/1.1.5_1/opt/lcoal/lib/python2.4/site-packages/PIL/
(684KB - this was generated by the py-pil install)
3) Desktop/Imaging-1.1.5/PIL/ (212KB - this was generated
by the PIL Imaging isntall)
4) Desktop/Imaging-1.1.5/build/lib.darwin-7.9.0-Power_macintosh-2.4/
(212KB - this was generated by the PIL Imaging install)

My goal is to get the self-test working properly. Somebody please help!

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Latest member

Latest Threads