Datasets:
PNG file corruption
#8
by
Lingshaw
- opened
The image file visdoc-tasks/esg_reports_human_labeled_v2/528.png
appears to be corrupted.
When using Pillow version 10.1 or higher to load and save the image, the following error occurs:
OSError: image file is truncated
However, the image can still be opened normally with the default image viewer on Windows, macOS, or Linux.
It’s recommended that the author re-save the file using the following code to fix the issue:
from PIL import Image, ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
path = ".../MMEB-V2/visdoc-tasks/visdoc-tasks/esg_reports_human_labeled_v2/528.png"
img = Image.open(path)
img.save(path)