Skip to content

Fix file position desync when calling into libtiff#8560

Merged
radarhere merged 6 commits into
python-pillow:mainfrom
Knio:tom/bufferedio
Nov 29, 2024
Merged

Fix file position desync when calling into libtiff#8560
radarhere merged 6 commits into
python-pillow:mainfrom
Knio:tom/bufferedio

Conversation

@Knio
Copy link
Copy Markdown
Contributor

@Knio Knio commented Nov 20, 2024

Fixes #8559

Changes proposed in this pull request:

  • Save and restore file handle position when passing file handle to libtiff

Comment thread src/PIL/TiffImagePlugin.py Outdated
@radarhere radarhere added the TIFF label Nov 20, 2024
@radarhere radarhere mentioned this pull request Nov 20, 2024
Comment thread Tests/test_libtiff_file_position.py Outdated
[
"Tests/images/old-style-jpeg-compression-no-samplesperpixel.tif",
"Tests/images/old-style-jpeg-compression.tif",
],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there anything different between these two files that means that one might conceivably fail where the other wouldn't? Or are you just testing two to be thorough?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, these were just the files that reproduced the issue

@radarhere radarhere merged commit 1c15225 into python-pillow:main Nov 29, 2024
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.

TIFF image loading EXIF corruption

2 participants