Skip to content

Conversation

@radarhere
Copy link
Member

Resolves #4940

#5416 allowed getexif() to read TIFF tag_v2 data. This PR allows that data to be saved again, using the exif keyword argument.

im.save("out.tiff", exif=im.getexif()

Comment on lines +1145 to +1147
# reset buffered io handle in case fp
# was passed to libtiff, invalidating the buffer
self.fp.tell()
Copy link
Member Author

Choose a reason for hiding this comment

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

This is copied from

# reset buffered io handle in case fp
# was passed to libtiff, invalidating the buffer
self.fp.tell()

@radarhere radarhere changed the title Added "exif" keyword argument to TIFF saving for Image.Exif instance Added "exif" keyword argument to TIFF saving Jul 4, 2021
@dbuscombe-usgs
Copy link

Is there some way I can upvote this? There is currently NO library for python (that I know) that will create tiffs from arbitrary arrays and exif data. It would be a huge benefit to a lot of people if PIL would support writing exif in the way that this PR deals with. Thanks!

@hugovk
Copy link
Member

hugovk commented Sep 6, 2021

@dbuscombe-usgs It should be in Pillow 8.4.0, to be released next month.

Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

Conflict needs resolving.

@hugovk hugovk merged commit ba7502c into python-pillow:master Sep 6, 2021
@radarhere radarhere deleted the tiff_exif branch September 6, 2021 22:24
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 tags are not available

3 participants