[Image-SIG] Installing libjpeg

Chris Barker Chris.Barker at noaa.gov
Fri May 14 20:16:11 CEST 2010

Mark Twenhafel wrote:
> Try adding
>    print Image.core.__file__
> to your script and make sure that the output is what you expect.

what was the result of that?

> At this point, my working hypothesis is that I did not install libjpeg 
> correctly.  I'm working on OS X Tiger.  What I did was download 
> "jpegsrc.v8a.tar.gz"; double-click in my download window in Firefox to 
> untar; move the untarred "jpeg-8" folder to /Application; open Terminal 
> and cd'ed to /Applications/jpeg-8; finally, I ran "./configure", "make", 
> and "make install". 
> It could be--and I don't know--that this install procedure did not 
> correctly add libjpeg to my Python 2.6 installation

no it wouldn't have done that.

> or that I need to 
> rebuild site-packages/PIL/_imaging.so in order to link-in libjpeg.

indeed you do.

> Belated point of clarification: I subsequently installed PIL using the 
> these instructions:
>         $ cd Imaging-1.1.7
>         $ python setup.py build_ext -i
>         $ python selftest.py

that should have built a new PIL, but it won't have installed it.

Did the selftest run OK?

> I just noticed that the file "site-packages/PIL/_imaging.so" was created 
> last October.

which is why you are getting an old one here.

>  If so, would be be possible or likely that this was built 
> using the version of libjpeg that didn't install on my machine?


>  If this 
> is correct, what is the best way to proceed?  My first inclination is to 
> delete the directory site-packages/PIL and reinstall. 

yup -- you may not even need to delete, but it won't hurt.

Take a look for a new _imaging.so that you should have just built. If 
you really want to know what it's linked to, try:

$ otool -L _imaging.so

But you might just do:

setup.py install

and see if it now works.

We really do need to get a Mac binary built!


Christopher Barker, Ph.D.

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov

More information about the Image-SIG mailing list