Add docstrings for getixif() and Exif

This commit is contained in:
Vladimir 2023-02-07 22:48:33 -08:00 committed by GitHub
parent 55d6cf5127
commit 1656753146
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1432,6 +1432,11 @@ class Image:
return {get_name(root.tag): get_value(root)}
def getexif(self):
"""
Gets EXIF data of the image.
:returns: an :py:class:`~PIL.Image.Exif` object.
"""
if self._exif is None:
self._exif = Exif()
self._exif._loaded = False
@ -3601,6 +3606,20 @@ atexit.register(core.clear_cache)
class Exif(MutableMapping):
"""
Exif class provides read and write access to EXIF image data.
Only basic information is available on the root level, in Exif object
itself. In order to access the rest, obtain their respective IFDs using
:py:meth:`~PIL.Image.Exif.get_ifd` method and one of
:py:class:`~PIL.ExifTags.IFD` members (most notably `Exif` and
`GPSInfo`).
Both root Exif and child IFD objects support dict interface and can be
indexed by int values that are available as enum members of
:py:class:`~PIL.ExifTags.Base`, :py:class:`~PIL.ExifTags.GPS`, and
:py:class:`~PIL.ExifTags.Interop`.
"""
endian = None
bigtiff = False