Skip to content

Commit 5a6293b

Browse files
authored
Merge pull request #6630 from radarhere/exiftags_enum
2 parents b6e0b66 + d03f35b commit 5a6293b

File tree

2 files changed

+336
-308
lines changed

2 files changed

+336
-308
lines changed

docs/reference/ExifTags.rst

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ provide constants and clear-text names for various well-known EXIF tags.
1111
:type: dict
1212

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

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

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

2626
>>> from PIL.ExifTags import GPSTAGS
2727
>>> GPSTAGS[20]
2828
'GPSDestLatitude'
29+
30+
31+
These values are also exposed as ``enum.IntEnum`` classes.
32+
33+
.. py:data:: Base
34+
35+
>>> from PIL.ExifTags import Base
36+
>>> Base.ImageDescription.value
37+
270
38+
>>> Base(270).name
39+
'ImageDescription'
40+
41+
.. py:data:: GPS
42+
43+
>>> from PIL.ExifTags import GPS
44+
>>> GPS.GPSDestLatitude.value
45+
20
46+
>>> GPS(20).name
47+
'GPSDestLatitude'

0 commit comments

Comments
 (0)