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 1 commit into from Oct 24, 2022

Added ExifTags enums #6630

merged 1 commit into from Oct 24, 2022


Copy link

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)

users could

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

hugovk approved these changes Oct 24, 2022
@hugovk hugovk merged commit 5a6293b into python-pillow:main Oct 24, 2022
60 checks passed
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants