Python with PIL and Libjpeg on Leopard

I'm having trouble getting images supported with PIL - this throws me this:

IOError: decoder jpeg not available

I installed PIL from binary, not realizing that I need libjpeg.

I installed libjpeg and freetype2 via fink.

I tried reinstalling PIL using the instructions at http://timhatch.com/ (bottom of page)

  • Download the source PIL 1.1.6 package and install the developer tools already installed
  • Patch setup.py with this patch so that it can find the Freetype that you already have.

    patch -p0 < leopard_freetype2.diff

  • sudo apt-get install libjpeg if you have fink (otherwise, create manually and configure the paths)

But I still get the same error.

I'm on Leopard PPC.

+3
source share
5

jpeg- django RHEL , PIL. PIL "python setup.py install", , , . : libjpeg , libjpeg-devel. PIL "python setup.py build", , , PIL jpeg, gif, freetype .., , jpeg . PIL .

+1

, :

rm PIL PIL.pth Imaging-1.1.6

:

http://blog.tlensing.org/2008/12/04/kill-pil-%E2%80%93-the-python-imaging-library-headache/

selftest.py . , macports jpeg-, JPEG_ROOT, include lib macports

+1

python libjpeg?

, , .

PIL, , libjpeg? (iirc), , , - .

. /configure time.

. , , , .

0

libjpeg, selftest , , , PIL, . , selftest.

, OP,

0

. - , 15 .

:

1. , jpeg lib :

file /usr/local/lib/libjpeg.7.dylib 

2.check, _imaging.so jpeg lib

cd ImageSrc

python setup.py build_ext -i

otool -L PIL/_imaging.so 

3. _imaging.so ,

cd PIL

python

import _imaging

4. , PIL * python "site-package", ,

python setup.py install

, 32- , , jpeg lib :

./configure CFLAGS="-arch i386" --enable-shared --enable-static
0
source

Source: https://habr.com/ru/post/1698913/


All Articles