2011-12-07 6 views
0

私はPIL、jpeg-8c、freetype-2.4.5とsorlのサムネイルをインストールしました。私のプロジェクトでは、私はsorl.thumbnailsettings.pyに入れました。私は、このコード行を使用する場合でも:Sorl Mac OSX 10.7.2のDjangoサムネイル

>>> from apps.news.models import Newtest 
>>> im = get_thumbnail(Newtest.objects.all()[0].image.name, '60') 

Newtest.objects.allを()[0] .imageは私のプロジェクト内の1つの画像です。

とエラーはこれです:それはなぜ

Traceback (most recent call last): 
    File "<console>", line 1, in <module> 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sorl_thumbnail-11.09-py2.7.egg/sorl/thumbnail/shortcuts.py", line 8, in get_thumbnail 
    return default.backend.get_thumbnail(file_, geometry_string, **options) 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sorl_thumbnail-11.09-py2.7.egg/sorl/thumbnail/base.py", line 61, in get_thumbnail 
    thumbnail) 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sorl_thumbnail-11.09-py2.7.egg/sorl/thumbnail/base.py", line 86, in _create_thumbnail 
    image = default.engine.create(source_image, geometry, options) 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sorl_thumbnail-11.09-py2.7.egg/sorl/thumbnail/engines/base.py", line 16, in create 
    image = self.colorspace(image, geometry, options) 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sorl_thumbnail-11.09-py2.7.egg/sorl/thumbnail/engines/base.py", line 34, in colorspace 
    return self._colorspace(image, colorspace) 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sorl_thumbnail-11.09-py2.7.egg/sorl/thumbnail/engines/pil_engine.py", line 56, in _colorspace 
    return image.convert('RGB') 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL/Image.py", line 679, in convert 
    self.load() 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL/ImageFile.py", line 189, in load 
    d = Image._getdecoder(self.mode, d, a, self.decoderconfig) 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL/Image.py", line 385, in _getdecoder 
    raise IOError("decoder %s not available" % decoder_name) 
IOError: decoder zip not available 

誰かが知っています?

THX

+0

がこのスレッドのように思えるのパッケージをインストールします> http://stackoverflow.com/questions/3544155/need-help-with-a-pil-error-ioerror-decoder-zip-利用不可 –

答えて

0

私はこの問題を解決してきた[OK]を、私はPILを削除し、このパッケージのlibjpeg-のlibpngをインストールし、PILに別の時間をインストールし、PILをupdgrade。

$ pip uninstall pil 

$ pip install pil --upgrade