Skip to content

Conversation

@radarhere
Copy link
Member

@radarhere radarhere commented Mar 16, 2024

Resolves #7876

The issue provided an image that raises ValueError: cannot fit 'int' into an offset-sized integer when seeking to a large offset in a TIFF image.

This changes it to be ValueError: Unable to seek to frame instead.

I'm not highly convinced of the need for this change, but it at least documents in our code that this may happen.

Also, if the image is instead a BytesIO instance,

from PIL import Image
from io import BytesIO
with open("crash-3", "rb") as fp:
    im = Image.open(BytesIO(fp.read()))

Pillow currently raises OverflowError: Python int too large to convert to C ssize_t. This would also become a ValueError with this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uncaught Exception(s) in Pillow Library

2 participants