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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 22 additions & 3 deletions docs/reference/ExifTags.rst
Expand Up @@ -11,7 +11,7 @@ provide constants and clear-text names for various well-known EXIF tags.
:type: dict

The TAGS dictionary maps 16-bit integer EXIF tag enumerations to
descriptive string names. For instance:
descriptive string names. For instance:

>>> from PIL.ExifTags import TAGS
>>> TAGS[0x010e]
Expand All @@ -20,9 +20,28 @@ provide constants and clear-text names for various well-known EXIF tags.
.. py:data:: GPSTAGS
:type: dict

The GPSTAGS dictionary maps 8-bit integer EXIF gps enumerations to
descriptive string names. For instance:
The GPSTAGS dictionary maps 8-bit integer EXIF GPS enumerations to
descriptive string names. For instance:

>>> from PIL.ExifTags import GPSTAGS
>>> GPSTAGS[20]
'GPSDestLatitude'


These values are also exposed as ``enum.IntEnum`` classes.

.. py:data:: Base

>>> from PIL.ExifTags import Base
>>> Base.ImageDescription.value
270
>>> Base(270).name
'ImageDescription'

.. py:data:: GPS

>>> from PIL.ExifTags import GPS
>>> GPS.GPSDestLatitude.value
20
>>> GPS(20).name
'GPSDestLatitude'