ds1054z
ds1054z copied to clipboard
can't save screen: PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x04031C58>
whenever i try to save a screenshot it raise pillow unidentify io_byte(as show in the picture)
I already try to reinstall pillow and set DISPLAY_DATA_BYTES to 1152000 but still didn't work
The issue seems that in case of 800x480 scopes the PNG file is truncated even if you set DISPLAY_DATA_BYTES to 1152000 (= 800x480x3).
Adding
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
after the block with
from PIL import Image, ImageOps, ImageEnhance
in cli.py seems to solve it as a workaround but the real issue is obviously somewhere else and needs to be fixed there.