使用django + Pillow进行图片上传压缩格式保存时出错的处理
安装Pillow之前先安装好python-dev libzip-dev libjpeg8-dev libfreetype6-dev libpng12-dev 否则在用PIL(Pillow)进行上传图片压缩格式保存时会出错:
encoder jpeg not available
decoder zip not available
sudo apt-get install python-dev libzip-dev libjpeg8-dev libfreetype6-dev libpng12-dev
pip uninstall Pillow
pip install Pillow
安装好后的报告如下:
PIL SETUP SUMMARY
version Pillow 2.6.1
platform linux2 2.7.6 (default, Mar 22 2014, 22:59:38)
[GCC 4.8.2]
TKINTER support not available
— JPEG support available
OPENJPEG (JPEG2000) support not available
— ZLIB (PNG/ZIP) support available
LIBTIFF support not available
— FREETYPE2 support available
LITTLECMS2 support not available
*** WEBP support not available
*** WEBPMUX support not available
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。