Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I recently wrote an article on how to get PIL, django, libjpeg to work nicely alongside Snow Leopard</p> <p><a href="http://appelfreelance.com/2010/06/libjpeg-pil-snow-leopard-python2-6-_jpeg_resync_to_restart/" rel="noreferrer">http://appelfreelance.com/2010/06/libjpeg-pil-snow-leopard-python2-6-_jpeg_resync_to_restart/</a></p> <p>I'll copy it in here for you too.</p> <p>If you don’t have this download it first.</p> <blockquote> <p><a href="http://www.ijg.org/files/jpegsrc.v7.tar.gz" rel="noreferrer">http://www.ijg.org/files/jpegsrc.v7.tar.gz</a></p> </blockquote> <p>go into your shell environment and untar by running the following</p> <blockquote> <p>tar -zxvf jpegsrc.v7.tar.gz<br /> cd jpeg-7</p> </blockquote> <p>then run</p> <blockquote> <p>sudo make clean<br /> sudo CC="gcc -arch i386”"./configure --enable-shared --enable-static<br /> sudo make<br /> sudo make install</p> </blockquote> <p>Next get PIL and untar it</p> <blockquote> <p><a href="http://effbot.org/downloads/Imaging-1.1.6.tar.gz" rel="noreferrer">http://effbot.org/downloads/Imaging-1.1.6.tar.gz</a><br /> tar -zxvf Imaging-1.1.6.tar.gz<br /> cd Imaging-1.1.6</p> </blockquote> <p>If you already have PIL I would recommend running</p> <blockquote> <p>sudo rm -Rf build</p> </blockquote> <p>to clean any existing builds, this has caused me loads of errors and gray hairs!</p> <p>in your settings.py file run find JPEG_ROOT</p> <p>amend it so it looks as follows</p> <blockquote> <p>JPEG_ROOT = libinclude(“/usr/local”)</p> </blockquote> <p>Next move onto the build</p> <blockquote> <p>sudo python setup.py build</p> </blockquote> <p>if libjpeg is successfully installed you should be able to run python selftest.py without any errors relating to “jpeg”</p> <blockquote> <p>sudo python setup.py install</p> </blockquote> <p>if all has worked successfully you should be able to enter your python interpreter by executing python in your command line and also do the following:</p> <blockquote> <p>import PIL<br /> import Image<br /> import _imaging</p> </blockquote> <p>without any errors.</p> <p>Just to triple check I have a simple jpeg on my desktop.</p> <blockquote> <p>image = Image.open(“/Users/MyName/Desktop/myimage.jpeg”)<br /> image.save(“/Users/MyName/Desktop/test.jpeg”)</p> </blockquote> <p>should work without errors </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload