#django filebrowser# problems and solutions

1. IOError: decoder jpeg not available

How to fix:

1. clear PIL packages (or pip uninstall pillow)

rm -rf /usr/lib/python2.7/site-packages/PIL
rm -rf /usr/lib/python2.7/site-packages/PIL.pth

or 

pip uninstall pillow

  

2. install required packages

ubuntu:
apt-get install libjpeg-dev
apt-get install libfreetype6-dev
apt-get install zlib1g-dev
apt-get install libpng12-dev

centos:
yum install zlib zlib-devel
yum install libjpeg libjpeg-devel
yum install freetype freetype-devel

3.download Image and install

wget http://effbot.org/downloads/Imaging-1.1.7.tar.gz
tar xzvf Imaging-1.1.7.tar.gz
cd Imaging-1.1.7
# if the sys is x64, you must also do this: edit the setup.py file and set:
# centOS:
TCL_ROOT = ‘/usr/lib64‘
JPEG_ROOT = ‘/usr/lib64‘
ZLIB_ROOT = ‘/usr/lib64‘
TIFF_ROOT = ‘/usr/lib64‘
FREETYPE_ROOT = ‘/usr/lib64‘
LCMS_ROOT = ‘/usr/lib64‘
# Ubuntu:
TCL_ROOT = ‘/usr/lib/x86_64-linux-gnu‘
JPEG_ROOT = ‘/usr/lib/x86_64-linux-gnu‘
ZLIB_ROOT = ‘/usr/lib/x86_64-linux-gnu‘
TIFF_ROOT = ‘/usr/lib/x86_64-linux-gnu‘
FREETYPE_ROOT = ‘/usr/lib/x86_64-linux-gnu‘
LCMS_ROOT = ‘/usr/lib/x86_64-linux-gnu‘

4.  create soft link

ln -s /usr/include/freetype2/freetype/ freetype

5. Python setup.py install

python2.7 setup.py install

  

2. IOError: broken data stream when reading image file

#django filebrowser# problems and solutions

时间: 2024-12-26 00:30:41

#django filebrowser# problems and solutions的相关文章

ubuntu using latex problems and solutions

Problem 1: input ptmr7t' failed to make ptmr7t.tfm this is a problem for missing times font. i.e. you used "usepackage{times}" in your tex file. If you install latex-font-recommended, the problem will be solved. Skill: less command can display p

解决难题:一些宝贵的经验教训 (Problems and Solutions – Scott Berkun)

发明万有引力的牛顿大家都知道,你知道他花了最多时间在研究什么?万有引力?微积分?光学? 其实牛顿晚年精力都放在研究点金术上,当时他做了无数的实验,希望能从中获得突破,最后却是徒劳.现在我们了解了物理与化学的原理,知道这种研究一定是没结果的.所以,要解决问题必须对问题有充分的了解--这是否是个可以解决的问题,否则只会花费无谓的精力. 爱因斯坦说,如果他有20天去解决一个问题,那么他会用19天去把问题定义好.也是同样的道理. 把问题定义清楚,定好整个框架,这是解决问题的第一步.比如Intuit公司(

[it-ebooks]电子书列表

#### it-ebooks电子书质量不错,但搜索功能不是很好 #### 格式说明  [ ]中为年份      ||  前后是标题和副标题  #### [2014]: Learning Objective-C by Developing iPhone Games || Leverage Xcode and Objective-C to develop iPhone games http://it-ebooks.info/book/3544/ Learning Web App Developmen

(转) [it-ebooks]电子书列表

[it-ebooks]电子书列表 [2014]: Learning Objective-C by Developing iPhone Games || Leverage Xcode and Objective-C to develop iPhone games http://it-ebooks.info/book/3544/Learning Web App Development || Build Quickly with Proven JavaScript Techniques http://

378. Kth Smallest Element in a Sorted Matrix

https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/#/solutions http://www.cnblogs.com/EdwardLiu/p/6109080.html Heap : public class Solution { public int kthSmallest(int[][] matrix, int k) { int n = matrix.length; PriorityQueue<Tupl

155. Min Stack - Unsolved

https://leetcode.com/problems/min-stack/#/solutions Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack. pop() -- Removes the element on top of the stack. top() -- Get

决定干点事儿--翻译一下《effective modern c++》

写了很多关于C++11的博客,总是觉得不踏实,很多东西都是东拼西凑.市场上也很少有C++11的优秀书籍,但幸运的是Meyers老爷子并没有闲赋,为我们带来了<effective modern c++>. 我们都要认清,一个人很难超越自我,超越自我的巅峰之作.因为不同的时代,也会早就不同的伟大作品. 说上面这段话的意思就是,我们不能期待<effective modern c++>能达到<effective c++>给我们带来的惊喜,但是也是出自大师之手. Learn ho

windows类书的学习心得(转载)

原文网址:http://www.blogjava.net/sound/archive/2008/08/21/40499.html 现在的计算机图书发展的可真快,很久没去书店,昨日去了一下,真是感叹万千,很多陌生的出版社,很多陌生的作者,很多陌生的译者,书名也是越来越夸张,什么××天精通××,精通××编程, ××宝典等等,书的印刷质量真的很好,纸张的质量也是今非昔比啊,但书的内容好象却是越来越让人失望,也许是我老了,我的思想我的观念已脱离现实社会,也许是外面的世界变化得太快,我编程数月,出去一走,

Android ListView 中的onItemClick方法中Intent 无法跳转的解决方案

I found this somewhere after googling There will be case that your custom list item doesn’t respond when you click…so what’s the reason and what’s the solution? Here several problems and solutions: 1. Scenario: list item layout contains CheckBox Prob