Reputation: 57973
Can anyone tell why PIL can't open this PNG file?
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
Upvotes: 3
Views: 20357
Reputation: 63
try to import cv2
>>> from PIL import Image
>>> import cv2
>>> im = cv2.imread("8.png")
>>> im = cv2.imwrite("8.png")
i hope its working...
Upvotes: 1
Reputation: 29394
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
Upvotes: 7