Skip to content

Added ExifTags enums#6630

Merged
hugovk merged 1 commit intopython-pillow:mainfrom
radarhere:exiftags_enum
Oct 24, 2022
Merged

Added ExifTags enums#6630
hugovk merged 1 commit intopython-pillow:mainfrom
radarhere:exiftags_enum

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.

2 participants