问题
img = Image.open(img_path)
然后报错:Image size (2415329280 pixels) exceeds limit of 178956970 pixels, could be decompression bomb DOS attack.
主要原因:
图像太大超过178956970 pixels
解决方法
加上:
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
Image.MAX_IMAGE_PIXELS = None