Python报错:IOError: image file is truncatedfrom PIL import ImageFile ImageFile.LOAD_TRUNCATED_IMAGE

IOError:image file is truncated.

报错原因:图像文件被截断;

解决办法:添加两行代码就可以轻松解决:

from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True

猜你喜欢

转载自blog.csdn.net/songchunxiao1991/article/details/83112123