After installing PIL, when processing jpg, it prompts "decoder jpeg not available". It turns out that PIL installation does not provide support for jpeg.
First uninstall the installed PIL:
On Mac, you can find site-packages as follows:
After searching, mine is under /Library/Python/2.7/site-packages.
Enter the directory, delete the PIL directory and PIL.pth, and the installed PIL will be uninstalled.
Download libjpeg and zlib:
http://www.ijg.org/files/jpegsrc.v7.tar.gz
http://zlib.net/zlib-1.2.7.tar.gz
Install libjpeg:
By default, it is installed under: /usr/local/lib.
Install zlib:
By default, it is installed under: /usr/local/lib.
Modify the setup.py of PIL:
Compile PIL:
test:
If prompted:
Then install:
Installed.
zz http://blog.csdn.net/liushuaikobe/article/details/8729652