473,394 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Help with JPEG support with PIL 1.1.5 and OSX

Hi

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
--------------------------------------------------------------------
PIL 1.1.5 BUILD SUMMARY
--------------------------------------------------------------------
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
755
changing mode of
/Library/Frameworks/Python.framework/Versions/2.4/bin/pildriver.py to
755
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
755
creating
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packag
es/PIL.pth
---------------------------------------------------------------------------------------
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
im.load()
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
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PIL/_imaging.so
------------------------------------------------------------------------
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
test.


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
http://download.savannah.gnu.org/releases/freetype/
--- 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 2188

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

Similar topics

0
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/...
7
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.
2
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...
3
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...
1
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...
2
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,...
11
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...
1
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...
11
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.