Python图像处理库 - Linux中的图像大小调整

时间:2013-08-11 10:19:45

标签: python python-imaging-library

from PIL import Image as image
img = image.open(filename)
img = img.resize((640,640))

这个代码在windows中运行得非常好,但它在ubuntu中给出了一些问题。 错误是 回溯(最近一次调用最后一次):

File "/home/prathprabhudesai/Imagga/Classifiertraining.py", line 82, in <module>
    img = img.resize((640,640))                           #Resize 
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1318, in resize
    self.load()
  File "/usr/lib/python2.7/dist-packages/PIL/ImageFile.py", line 192, in load
    d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
AttributeError: 'module' object has no attribute '_getdecoder'

1 个答案:

答案 0 :(得分:0)

我遇到了类似的问题,因为我使用的是Spyder。检查此主题:http://comments.gmane.org/gmane.comp.python.scientific.spyder/2465