[Image-SIG] Please test PIL package on OS-X

Karsten Hiddemann karsten.hiddemann at mathematik.uni-dortmund.de
Fri May 2 23:38:44 CEST 2008


Here is my experience with it on a Mac OS X 10.5.2 system:

- clicked on the SimplePILTest thing. Nothing happens. Is it broken?
- I try to start it via Terminal:

$ ./SimplePILTest.app/Contents/MacOS/python
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import site' failed; use -v for traceback
Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> ^D

$ ./SimplePILTest.app/Contents/MacOS/python -v
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
'import site' failed; traceback:
ImportError: No module named site
Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>>

- I try to install PIL now. First the FreeType framework, then the 
UnixImageIO framework. Installs okay. Then I try to install PIL:

The installer tells me that "PIL requires System Python 2.5 to install."

- To my surprise (I am new to this whole Mac experience) Python 2.5.1 is 
already preinstalled on my system. But PIL doesn't want to install on 
that. So I download the Python 2.5.2 build from python.org and install 
that. After this, the PIL package installs fine.

- Now I try to run the script by hand:

$ python SimplePILTest.py SafetyGirl1-small.jpg
Processing: SafetyGirl1-small.jpg
It is a JPEG, (461, 615), RGB image
writing out a version with some text on it:
Traceback (most recent call last):
   File "SimplePILTest.py", line 17, in <module>
     font = ImageFont.truetype("veraBd.ttf", 60)
   File 
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/PIL/ImageFont.py", 
line 205, in truetype
     return FreeTypeFont(filename, size, index, encoding)
   File 
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/PIL/ImageFont.py", 
line 121, in __init__
     self.font = _imagingft.getfont(file, size, index, encoding)
IOError: cannot open resource

- It needs the font file, which isn't in there. So I do:

$ cd SimplePILTest.app/Contents/Resources/
$ python SimplePILTest.py ../../../SafetyGirl1-small.jpg
#Processing: ../../../SafetyGirl1-small.jpg
It is a JPEG, (461, 615), RGB image
writing out a version with some text on it:

- It works, it actually produced a watermarked image! Wait, that means 
that I should have just dropped the image on the App? (tries) Yes, that 
works, too. Maybe I should have tested that before installing Python 
2.5.2 and PIL and the other frameworks to test the standalone version.

So, to sum it up: It does work, very nice work. But you should have 
described a little better what one is supposed to do to test it. ;)

What I dislike: There's no way to uninstall these thing again right now.


More information about the Image-SIG mailing list