PIL Image "image file is truncated" problem analysis and solution in Python program

error code

OSError: image file is truncated (54 bytes not processed)

Solution

Option 1: Find the picture of the missing content

The second: add code to the running program

from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True

Guess you like

Origin blog.csdn.net/Hi_one_two_three/article/details/130306278