472,802 Members | 1,316 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,802 software developers and data experts.

Help with JPEG support with PIL 1.1.5 and OSX


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
setup.py script.

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

I tried running the self-test and this is my output:
************************************************** ***************
Failure in example: _info(Image.open("Images/lena.jpg"))
from line #24 of selftest.testimage
Exception raised:
Traceback (most recent call last):
File "./doctest.py", line 499, in _run_examples_inner
exec compile(source, "<string>", "single") in globs
File "<string>", line 1, in ?
File "./selftest.py", line 21, in _info
File "PIL/ImageFile.py", line 180, in load
d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
File "PIL/Image.py", 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 _imaging.so 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 (http://py-pil.darwinports.com/).
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 http://www.ijg.org/files
--- 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 http://effbot.org/downloads/
--- 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 _imaging.so file which was 684KB.

I copied this newly created _imaging.so 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 _imaging.so 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 self_test.py 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 _imaging.so turns up 4 sources:
1) /opt/local/lib/python2.4/site-package/PIL/_imaging.so (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/_imagin.so
(684KB - this was generated by the py-pil install)
3) Desktop/Imaging-1.1.5/PIL/_imaging.so (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/_imaging.so
(212KB - this was generated by the PIL Imaging install)

My goal is to get the self-test working properly. Somebody please help!
Jack Wu
Sep 22 '06 #1
0 2133

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Pilu | last post by:
Hi....I have a problem: I installed apache 1.3 on fedora core 3... I also installed jpeg-6b, gd-2.0.28, and I configured php5 with gd and jpeg support --with-gd=/usr/local/gd2/...
by: google12 | last post by:
hi, May anyone help me? I need a lib which support .jpeg file with RGBA mode. PIL seems to support RGB and CMYK mode only... Thanks for your help.
by: Jerry | last post by:
Hi, I am (today!) starting to Python... I am runnin MacOS X 10.3.3 with: 1) "Batteries included" Aqua Tcl/Tk version 8.4.5 2) The 2.3 version of Python that comes with the OS 3) The...
by: Steve Holden | last post by:
If nobody has a quick answer I'll go to the PIL list, but I'm having problems with PIL JPEG support on Windows, and figured someone on c.l.py might have solved this problem. I built the Cygwin...
by: scorpion53061 | last post by:
I really like this javascript for an image slideshow. The only thing I woudl like to do differently is have a cell above the image and navigation that would allow text content to be placed. Does...
by: B Squared | last post by:
I recently installed PHP 5.0.4 on my Fedora system. I compiled in the GD option. (--with-gd). Then I tested the ImageTypes() function. It seems .png and .gif (IMG_PNG and IMG_GIF) are supported,...
by: cybervigilante | last post by:
I can't seem to change the include path on my local winmachine no matter what I do. It comes up as includ_path .;C:\php5\pear in phpinfo() but there is no such file. I installed the WAMP package...
by: alcool | last post by:
Hi, I would like use a socket for write a file jpeg on the network. In others words, it is possible to publish a jpeg (like a streamer) that a client can fetch and view? file JPEG -socket that...
by: Mark B | last post by:
I want to display a pre-designed graphical 'performance badge' on certain webpages (round, about 2cm diameter) next to a salesperson's details. I have a function,...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: lllomh | last post by:
How does React native implement an English player?
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.