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

TIFF EXIF data is not updated when saving image #6334

Closed
gverm opened this issue May 26, 2022 · 3 comments · Fixed by #6335
Closed

TIFF EXIF data is not updated when saving image #6334

gverm opened this issue May 26, 2022 · 3 comments · Fixed by #6335

Comments

@gverm
Copy link

gverm commented May 26, 2022

What did you do?

Tried to add 'Artist' and 'Copyright' exif fields to artwork.tiff

What did you expect to happen?

Exif to be saved and viewable for artwork.tiff.

What actually happened?

Exif data was not updated and loading the image with Pillow again also didn't show the updated data.

What are your OS, Python and Pillow versions?

  • OS: Linux
  • Python: 3.10.4
  • Pillow: 9.1.1
img = Image.open("artwork.tiff")
exif = img.getexif()
exif[0x8298] = "test"
exif[0x013B] = "test"
img.save("artwork.tiff", exif=exif)

artwork.zip
The tiff in the zip above was created by converting the svg I will attach below using ImageMagick.
artwork-00.svg

Pillow saved the image successfully, no failure messages were shown.

@radarhere
Copy link
Member

Hi. If you'd like an immediate workaround, adding in img.load() saves the data correctly.

from PIL import Image
img = Image.open("artwork.tiff")
exif = img.getexif()
img.load()
exif[0x8298] = "test"
exif[0x013B] = "test"
img.save("artwork.tiff", exif=exif)

@radarhere
Copy link
Member

I've created PR #6335 to resolve this.

@gverm
Copy link
Author

gverm commented May 27, 2022

@radarhere Thank you for the very fast response. I can confirm your workaround works.

gverm added a commit to inuits/elody-storage that referenced this issue Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants