gpt4 book ai didi

python-imaging-library - IOError : cannot identify image file

转载 作者:行者123 更新时间:2023-12-04 00:16:04 25 4
gpt4 key购买 nike

谁能告诉为什么 PIL 不能打开这个 PNG 文件?

https://b75094855c6274df1cf8559f089f485661ae1156.googledrive.com/host/0B56ak7W-HmqAX005c3g5eTlBakE/8.png

我得到 IOError: cannot identify image file,通过查看代码,它似乎尝试了 PIL.PngImagePlugin.PngImageFile 和相应的“accept”函数,它返回 False

我使用的是 1.1.6 版

最佳答案

我不知道 PIL 1.1.6 的问题是什么,但我只是用最新的 Pillow 2.4.0 对其进行了测试,这很有效:

>>> from PIL import Image
>>> im = Image.open("8.png")
>>> im.show()

未维护的 PIL 和 Pillow 是一个积极维护和开发的分支。要使用 Pillow,请先卸载 PIL,然后安装 Pillow。

更多安装说明:http://pillow.readthedocs.org/en/latest/installation.html

关于python-imaging-library - IOError : cannot identify image file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24420817/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com