XQuartz ships an older freetype that still has a top-level "ft2build.h"
header file. Homebrew's freetype is newer and does not have this file,
it only has "freetype2/ft2build.h".
setup.py finds the header in XQuartz first, but Homebrew's compiler
wrappers intentionally strip out the XQuartz include paths during the
build unless the package depends on it explicitly.
We want to prefer Homebrew's freetype anyway, so if it's installed,
let's not even bother to search the XQuartz paths.
platforma.processor() will return x86_64 on a 64 bit linux system;
however, this it wrong for 32 bit compiled python. By looking at
platform.architecture() first it correctly notes the 32bit
compile.
Somehow I merged pino's commit into rel_2.3 branch (which I since removed because it was confusing me). Not sure what happened, but this is his code that got lost.
I've recently included Pillow with a py2app build of a frozen application on OS X. When Pillow is installed on a machine that has X11, the preference for X11's libfreetype causes a new dependency for my frozen app. I don't want my users to be required to install X11 if they don't have to (it's not included by default after OS X 10.8).
This PR adds a preference for homebrew's libfreetype (if available), which py2app detects and includes, and which doesn't create an X11 dependency in apps that are frozen and use Pillow (PIL).
This change allows Pillow to discover installed libs on OSX when using the homebrew package manager outside of `/usr/local/`.
It relies on the commands module, which goes away in Python 3. If it seems like a good change to add, I can switch the code over to subprocess.
Pillow now uses the webpmux library to envelop the webp images in RIFF. This allows for easy support of exif and icc_profile metadata.
Also included tests that verify compatibility with jpeg for exif and icc_profile metadata.
If the user does not have webp with webpmux enabled, pillow will fall back to the previous approach, meaning no exif or icc_profile metadata will be read or written to.