From ce905dea74387b1e369b323acc183f6e1bdb3506 Mon Sep 17 00:00:00 2001 From: Melon Mouse <73140350+melonmouse@users.noreply.github.com> Date: Fri, 16 Sep 2022 10:56:45 +0200 Subject: [PATCH] Add include inverse mappings to ExifTags docs. --- docs/reference/ExifTags.rst | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/docs/reference/ExifTags.rst b/docs/reference/ExifTags.rst index 4567d4d3e..e2241dc2f 100644 --- a/docs/reference/ExifTags.rst +++ b/docs/reference/ExifTags.rst @@ -4,25 +4,45 @@ :py:mod:`~PIL.ExifTags` Module ============================== -The :py:mod:`~PIL.ExifTags` module exposes two dictionaries which +The :py:mod:`~PIL.ExifTags` module exposes four dictionaries which provide constants and clear-text names for various well-known EXIF tags. .. py:data:: TAGS :type: dict - The TAG dictionary maps 16-bit integer EXIF tag enumerations to - descriptive string names. For instance: + The TAGS dictionary maps 16-bit integer EXIF tag enumerations to + descriptive string names. For instance: >>> from PIL.ExifTags import TAGS >>> TAGS[0x010e] 'ImageDescription' + +.. py:data:: TAG_CODES + :type: dict + + The TAG_CODES dictionary maps descriptive string names to 16-bit integer EXIF + tag enumerations. For instance: + + >>> from PIL.ExifTags import TAG_CODES + >>> TAG_CODES['ImageDescription'] + 0x010e .. py:data:: GPSTAGS :type: dict The GPSTAGS dictionary maps 8-bit integer EXIF gps enumerations to - descriptive string names. For instance: + descriptive string names. For instance: >>> from PIL.ExifTags import GPSTAGS >>> GPSTAGS[20] 'GPSDestLatitude' + +.. py:data:: GPS_CODES + :type: dict + + The GPS_CODES dictionary maps descriptive string names to 8-bit integer EXIF + gps enumerations. For instance: + + >>> from PIL.ExifTags import GPSTAGS + >>> GPS_CODES['GPSDestLatitude'] + 20