Skip to content

If every TIFF tile covers the image, only use the last offset #8820

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

Merged
merged 1 commit into from
Mar 18, 2025

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Mar 17, 2025

#5919 reduced the load time for images that have consecutive tiles only differing in their offset. The test image in test_timeout() was a TIFF file, but the change was made more generally to ImageFile.

After python-pillow/docker-images#232, QEMU jobs in the docker-images repository are slower, and test_timeout() is now timing out.

This PR adds specific logic to TiffImagePlugin. Each tile has the same width and height, so if that width and height covers the image and there are no layers involved, then only the last offset is needed.

@radarhere radarhere added the TIFF label Mar 17, 2025
@radarhere radarhere marked this pull request as draft March 17, 2025 12:15
@radarhere radarhere changed the title Do not add consecutive duplicate TIFF tiles that only differ by their offset If every TIFF tile covers the image, only use the last offset Mar 17, 2025
@radarhere radarhere marked this pull request as ready for review March 17, 2025 13:21
@hugovk hugovk merged commit 039ecac into python-pillow:main Mar 18, 2025
55 checks passed
@radarhere radarhere deleted the tiff_timeout branch March 18, 2025 20:41
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.

2 participants