Skip to content. | Skip to navigation

Sections
Personal tools
What is this?
Hi, my name is Tom Lazar and I'm a Plone and Zope developer based in Berlin, Germany and this is my personal and professional (no big difference, really...) website.
 

Installing libjpeg on OS X

Filed Under:

From the This-gotta-get-easier-Department

Installing the Python Image Library on Mac OS X is still causing me some headaches, despite having found a working solution previously. My main gripe with that solution is, that it relies on Darwin Ports to install the necessary supporting libraries for PIL to handle jpeg, png and other formats.

These days I’m rather wary of tools such as fink or DarwinPorts – I don’t install that terribly much stuff in the first place, anyway and secondly, the out-of-the-box install experience for most tools has significantly improved over the past two years (mainly, I assume, because a lot of UNIX/Linux developers use Mac OS X themselves these days).

Well, exceptions prove a rule, as they say and libjepg does just that. Luckily, Matías Giovannini has shared how he managed to install libjepg (and other libs!) on Mac OS X in his account of installing GD40.

For libjpeg it boils down to this (after downloading and unpacking the sources):

% cd jpeg-6b/
% ln -s `which glibtool` ./libtool
% setenv MACOSX_DEPLOYMENT_TARGET 10.4
% ./configure --enable-shared && make && sudo make install

Then you can proceed to install PIL itself (the order is crucial, because if libjepg isn’t present at install time, PIL will be built without support for it.)

Also, if you’re experiencing trouble with getting resized images to show up, you should pay portal_atct/manage_imageScales in ZMI a visit and let it recreate the sizes.

corrections

Posted by Klaus at Mar 30, 2006 10:47 AM

For me it didn't work fully.

I had to do: export MACOSX_DEPLOYMENT_TARGET=10.4 instead of setenv and also a sudo for the install is necessary

bash vs. tcsh

Posted by Tom Lazar at Apr 06, 2006 08:15 AM

thanks, klaus. i should have pointed out, that i'm a) using tcsh (instead of the default bash) and b) was performing the commands as root.

Great article

Posted by Max at Mar 16, 2007 06:43 PM

Just what I was looking for to cure my install problems with mjpeg tools!

Thanks

Posted by Anonymous User at Sep 17, 2008 10:21 AM

I was trying to get PIL going, and this was just the answer I needed.