Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't save screen: PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x04031C58> #17

Open
isarafx opened this issue Oct 28, 2020 · 1 comment

Comments

@isarafx
Copy link

isarafx commented Oct 28, 2020

ภาพ
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

@B-G-T
Copy link

B-G-T commented Nov 1, 2020

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.

finger563 added a commit to finger563/ds1054z that referenced this issue Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants