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

Allow getexif() to access TIFF tag_v2 data #5416

Merged
merged 1 commit into from Jun 28, 2021

Conversation

radarhere
Copy link
Member

Helps #4940

The issue expected "To be able to access exif tags of my tiff files".

https://en.wikipedia.org/wiki/Exif#Technical

When Exif is employed in TIFF files (also when used as "an embedded TIFF file" mentioned earlier), the TIFF Private Tag 0x8769 defines a sub-Image File Directory (IFD) that holds the Exif specified TIFF Tags. In addition, Exif also defines a Global Positioning System sub-IFD using the TIFF Private Tag 0x8825, holding location information, and an "Interoperability IFD" specified within the Exif sub-IFD, using the Exif tag 0xA005.

So at top level, there are two IFDs - Exif and GPS.

Then what should existing method getexif() do for a TIFF image?

One could argue that it should just get the Exif IFD... but then how do users get to the GPS IFD?
One could then argue that it should return a dictionary with just the Exif and the GPS IFDs.
But don't you feel that users will then start to report that other data is missing? Particularly if a later PR adds the ability to use the exif argument when saving TIFFs.

I think that the nicest option might be to just provide all the tag_v2 data to getexif(). This isn't just a simple clone of tag_v2 though - it also provides access to get_ifd() - im.getexif().get_ifd(0x8825) would get the GPS IFD.

@radarhere radarhere force-pushed the tiff_exif branch 2 times, most recently from 7d9504e to 622ba12 Compare April 29, 2021 12:10
@radarhere radarhere mentioned this pull request Jun 9, 2021
@hugovk hugovk merged commit 6d94376 into python-pillow:master Jun 28, 2021
@hugovk hugovk mentioned this pull request Jun 28, 2021
23 tasks
@radarhere radarhere deleted the tiff_exif branch June 28, 2021 22:56
radarhere added a commit to radarhere/Pillow that referenced this pull request Jun 30, 2021
radarhere added a commit to radarhere/Pillow that referenced this pull request Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants