-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Some PCX files trigger OSError since 8.1.0 #5203
Copy link
Copy link
Closed
Description
What did you do?
In OpenTTD/nml we use pillow to manipulate images, mainly cropping, but I also tested with show() and save().
I think it's related to 2f40926
What did you expect to happen?
I expect the images to be loaded as they were with previous (<8.1.0) pillow versions.
What actually happened?
Depending on the used file it fails to load with OSError: buffer overrun when reading image file or OSError: image file is truncated (0 bytes not processed). But not all images fail to load.
What are your OS, Python and Pillow versions?
- OS: Any (tested on Ubuntu, MacOS and Windows)
- Python: >3.5 (tested on 3.6, 3.7, 3.8)
- Pillow: 8.1.0
This is a simple test case with images that used to load fine. One still works, the two others trigger the different OSError
from PIL import Image
files = ["arctic_railwagons.pcx", "opengfx_generic_trams1.pcx", "opengfx_trains_start.pcx"]
for file in files:
try:
with Image.open(file) as im:
print("{}:{} {} {}".format(file,im.format, im.size, im.mode))
im.save(file + ".png")
except OSError as e:
print("Failed with '{}'".format(str(e)))Images and test code in pillow-test.zip
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels