我试图加载我的 .jpg 文件,但它引发了错误,但如果我再试一次,就可以正常工作!为什么?
我的代码和错误信息:
>>> import Image
>>> im1 = Image.open('/tmp/test.jpg')
>>> im1.load()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.7/site-packages/PIL/ImageFile.py", line 201, in load
raise IOError("image file is truncated (%d bytes not processed)" % len(b))
IOError: image file is truncated (0 bytes not processed)
>>> im1.load()
<PixelAccess object at 0x7feffc2a1170>
>>>
谢谢!