您的位置:首页 > 编程语言 > Python开发

Ubuntu 13.10 下 Python2.7版 PIL 的一个bug修复

2014-04-05 12:12 337 查看
报错为:

Traceback (most recent call last):
File "twrp_font3.py", line 43, in <module>
text.text(((width_en-text_size[0])/2,y_en), en[i], 255, font_en)
File "/usr/lib/python2.7/dist-packages/PIL/ImageDraw.py", line 256, in text
ink, fill = self._getink(fill)
File "/usr/lib/python2.7/dist-packages/PIL/ImageDraw.py", line 144, in _getink
if self.palette and not Image.isNumberType(ink):
AttributeError: 'module' object has no attribute 'isNumberType'


解决方法,参考这个网址:

https://github.com/jj1bdx/wspr/tree/master/FIX-Ubuntu-13.04

将上面的ImageDraw.py替换原来的即可:

https://github.com/python-imaging/Pillow/blob/1f41e25b4feec620ad32e8b3a9b28466f63b3afe/PIL/ImageDraw.py

替换到 下面的目录下, 注意修改权限为644,

同时要将该目录下的ImageDraw.pyc删除

/usr/lib/python2.7/dist-packages/PIL/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: