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

PIL throws this error, if the loaded image file is truncated.
You could try to isolate this file and remove it or use

from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True

to load this file nevertheless.

5 Likes