Skip to content
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

Do not preserve EXIFIFD tag by default when saving TIFF images #8110

Merged
merged 2 commits into from
Jun 28, 2024

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Jun 6, 2024

Resolves #8106

The EXIFIFD tag is 'a pointer to the Exif IFD'. However, there's no reason why the data should be located at that very same position in the image that Pillow creates.

So this PR does not preserve it by default when saving TIFF images. The user may still provide it through an encoder argument.

@@ -686,12 +686,17 @@ def test_save_ycbcr(self, tmp_path: Path) -> None:
assert reloaded.tag_v2[532] == (0, 255, 128, 255, 128, 255)

def test_exif_ifd(self, tmp_path: Path) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

The tmp_path parameter can be removed now.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've updated the commit.

Comment on lines 1819 to 1820
# SAMPLEFORMAT is determined by the image format and should not be copied
# from legacy_ifd.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add EXIFIFD to this comment?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've updated the commit.

@hugovk hugovk merged commit 41426a6 into python-pillow:main Jun 28, 2024
55 of 56 checks passed
@radarhere radarhere deleted the exififd branch June 28, 2024 07:21
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.

save() produces an unreadable TIFF
3 participants