PIL这个包的全称是Python Imaging Library。
PIL提供强大的图形处理的能力,并提供广泛的图形文件格式支持,该库能进行图形格式的转换、打印和显示。还能进 行一些图形效果的处理,如图形的放大、缩小和旋转等。是Python用户进行图象处理的强有力工具。
下载:
我下载的版本是:1.1.7
$ tar xvfz Imaging-1.1.7.tar.gz
$ cd Imaging-1.1.7
查看README,看来需要安装一些其它的库,已实现它的特性:
1. Prerequisites.
If you need any of the features described below, make sure you
have the necessary libraries before building PIL.
feature library
-----------------------------------------------------------------
JPEG support libjpeg (6a or 6b)
/files/jpegsrc.v6b.tar.gz
ftp://ftp.uu.net/graphics/jpeg/
PNG support zlib (1.2.3 or later is recommended)
OpenType/TrueType freetype2 (2.3.9 or later is recommended)
support
CMS support littleCMS (1.1.5 or later is recommended)
support
If you have a recent Linux version, the libraries provided with the
operating system usually work just fine. If some library is
missing, installing a prebuilt version (jpeg-devel, zlib-devel,
etc) is usually easier than building from source.
那好吧, 就索性都给安装上吧。。。
1. 安装libjpeg
wget /files/jpegsrc.v6b.tar.gz
解压后进入文件夹,查看README,没啥特殊说明。
./configure
make
make install
2. 安装zlib
我下载的是:zlib-1.2.8.tar.gz
同上, 默认安装。
3. 安装freetype2
地址:我下载的是:freetype-2.5.0.1.tar.gz
同上, 默认安装。
configure: error: `libpng-config' not found;
那好吧。。安装libpng
wget
我去。。。
make时报错:/root/work/libpng-1.6.6/contrib/tools/pngfix.c:2151: undefined reference to `inflateReset2'
经查询,`inflateReset2'这货在zlib库里啊。
算了,暂时用:./configure --without-png
4. 安装littleCMS
wget
默认安装
OK, 再次进入主题。
$ cd Imaging-1.1.7
安装:
python setup.py install