Skip to content

Commit

Permalink
Merge pull request #6630 from radarhere/exiftags_enum
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored Oct 24, 2022
2 parents b6e0b66 + d03f35b commit 5a6293b
Show file tree
Hide file tree
Showing 2 changed files with 336 additions and 308 deletions.
25 changes: 22 additions & 3 deletions docs/reference/ExifTags.rst
Original file line number Diff line number Diff line change
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'
Loading

0 comments on commit 5a6293b

Please sign in to comment.