You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PyEncoder.encode_to_file() writes buf[status:], where status is the number of encoded bytes. An encoder returning a complete buffer consequently writes nothing #10096
The same encoder through ImageFile._save() writes b'ABC' to BytesIO, but an empty buffer to a real file.
Write the encoded prefix at ImageFile.py:935, rather than slicing it off. This affects non-push Python encoders; the bundled QOI/BLP encoders use a different path.
Reproduced on Pillow 13.0.0.dev0, Python 3.13.15, with the original Python sources and C extension built from this checkout.
changed the title [-]`PyEncoder.encode_to_file()` writes `buf[status:]`, where `status` is the number of encoded bytes. An encoder returning a complete buffer consequently writes nothing.[/-][+]`PyEncoder.encode_to_file()` writes `buf[status:]`, where `status` is the number of encoded bytes. An encoder returning a complete buffer consequently writes nothing[/+]on Oct 2, 2026
Activity
radarhere commentedon Oct 2, 2026
You're right. I've created #10098
[-]`PyEncoder.encode_to_file()` writes `buf[status:]`, where `status` is the number of encoded bytes. An encoder returning a complete buffer consequently writes nothing.[/-][+]`PyEncoder.encode_to_file()` writes `buf[status:]`, where `status` is the number of encoded bytes. An encoder returning a complete buffer consequently writes nothing[/+]