问题描述
谁能说出PIL为什么无法打开此PNG文件?
Can anyone tell why PIL can't open this PNG file?
https://b75094855c6274df1cf8559f089f485661ae1156. 8.png
我得到IOError:无法识别图像文件,并且通过查看代码,似乎它尝试了PIL.PngImagePlugin.PngImageFile和相应的"accept"函数,并返回False
I get IOError: cannot identify image file, and by looking at the code, it seems it tries PIL.PngImagePlugin.PngImageFile and corresponding "accept" function, and it returns False
我正在使用1.1.6版
I'm using version 1.1.6
推荐答案
我不知道PIL 1.1.6的问题是什么,但我只是使用最新的Pillow 2.4.0进行了测试,并且有效:
I don't know what the problem is with PIL 1.1.6 but I just tested it with the latest Pillow 2.4.0 and this worked:
>>> from PIL import Image
>>> im = Image.open("8.png")
>>> im.show()
PIL处于未维护状态,而Pillow是一个积极维护和开发的货叉.要使用Pillow,请先卸载PIL,然后再安装Pillow.
PIL in unmaintained and Pillow is an actively maintained and developed fork. To use Pillow, first uninstall PIL, then install Pillow.
此处的其他安装说明: http://pillow.readthedocs.org/en/latest /installation.html
Further installation instructions here: http://pillow.readthedocs.org/en/latest/installation.html
这篇关于IOError:无法识别图像文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!