Spinsels op het web
actions » SearchLogin 124 articles • 08 Sep 2008

Article with comments

Saturday, 02 Aug 2008

permalink Python Imaging Library (PIL) op Mac OS X inclusief libjpeg en freetype2

Ik wilde image manipulatie doen vanuit Python op mijn Mac. Dan kom je zo'n beetje automatisch op PIL uit.

Nou kun je de voorgecompileerde installatie van PythonMac.org proberen, maar die is voor Python 2.5 op Mac OS 10.4 (universal binary). Bij mij werkte dat perfect. Wellicht werkt hij ook op 10.5 (ik heb zelf 10.4).

Als hij niet werkt of je wilt zelf PIL compileren, dan moet je met een aantal dingen rekening houden...

Benodigdheden:

  1. Compile & install libjpeg
    $ cd jpeg-6b/
    $ ln -s `which glibtool` libtool
    $ export MACOSX_DEPLOYMENT_TARGET=10.4
    $ ./configure --enable-shared --enable-static --host=powerpc
    $ make
    $ sudo make install

  2. Compile & install freetype2
    (>) Activeer eerst de bytecode hinting en subpixel rendering door wat #defines aan te zetten in een headerfile. Zie docs/TRUETYPE voor details.

    $ cd freetype-2.3.7/
    $ rm config.mk
    $ ./configure
    $ make
    $ sudo make install

  3. Compile & install PIL

    $ cd Imaging-1.1.6
    $ python setup.py build

    Hij zou nu moeten aangeven in een BUILD SUMMARY: TKINTER support OK, JPEG support ok, ZLIB/PNG support ok, FREETYPE2 support ok.

    $ sudo python setup.py install
    $ python selftest.py

    De selftest moet foutloos verlopen en iets zeggen als "57 tests passed".

• Wrote irmen at 02:13 | read 13× | Add comment

Comments (0)

No comments for this article yet.

Write a comment

Your name  
E-mail   (only visible for blog owner)
Homepage
Text:

[b] [i] [u] [tt] [center] [code] [quote] [url] [url=] [img] [@] [@@] [@:]
detailed help about markup
You must answer the following to be able to submit.
[Captcha Image] Type the letters you see in the image.
(Unreadable? Click 'Preview' for a new one)

Process times: page=0.032 request=0.177 cpu=0.040