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

Added ExifTags enums #6630

Merged
merged 1 commit into from Oct 24, 2022
Merged

Added ExifTags enums #6630

merged 1 commit into from Oct 24, 2022

Conversation

radarhere
Copy link
Member

Alternative to #6586

This PR effectively copies the data from ExifTags.TAGS and ExifTags.GPSTAGS into two new IntEnum classes, ExifTags.Base and ExifTags.GPS.

The advantage of this is ease of mapping a tag name to a tag number. Rather than

>>> from PIL.ExifTags import TAGS
>>> for value, name in TAGS.items():
...   if name == "ImageDescription":
...     print(value)
... 
270

users could

>>> from PIL.ExifTags import Base
>>> Base.ImageDescription.value
270

@hugovk hugovk merged commit 5a6293b into python-pillow:main Oct 24, 2022
@radarhere radarhere deleted the exiftags_enum branch October 24, 2022 21:19
radarhere added a commit to radarhere/Pillow that referenced this pull request Oct 24, 2022
hugovk added a commit that referenced this pull request Oct 25, 2022
dairiki added a commit to dairiki/typeshed that referenced this pull request Apr 16, 2023
The Base and GPS enums were added in Pillow 9.3.0
(python-pillow/Pillow#6630)
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.

None yet

2 participants