Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IOError: cannot identify image file

Can anyone tell why PIL can't open this PNG file?

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

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

I'm using version 1.1.6

like image 297
Yaroslav Bulatov Avatar asked Dec 04 '25 01:12

Yaroslav Bulatov


1 Answers

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 in unmaintained and Pillow is an actively maintained and developed fork. To use Pillow, first uninstall PIL, then install Pillow.

Further installation instructions here: http://pillow.readthedocs.org/en/latest/installation.html

like image 64
Hugo Avatar answered Dec 07 '25 02:12

Hugo