Monday, December 13, 2010

Including Jpeg support in PIL on centos box

There are a lot of posts out that say to install the libraries jpeg and jpeg-devel prior to installing PIL, but this did not work for me on Cento. For example this site http://www.jroller.com/RickHigh/entry/installing_pil_python_image_library suggests using the command:

$ sudo yum install freetype freetype-devel jpeg jpeg-devel libpng libpng-devel
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
No Match for argument: jpeg <<----- note the error here
No Match for argument: jpeg-devel <<----- and here
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for libpng to pack into transaction set.
......



Instead use:

$ sudo yum install freetype freetype-devel libpng libpng-devel libjpeg libjpeg-devel


If you have already got as far as installing PIL, delete it from the site-packages directory and reinstall, I use easy_install PIL, and this will rebuild PIL, this time with jpeg support.

--------------------------------------------------------------------
*** TKINTER support not available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
*** LITTLECMS support not available
--------------------------------------------------------------------

No comments: