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

Updated docstring #5708

Merged
merged 2 commits into from Sep 11, 2021
Merged
Changes from 1 commit
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
54 changes: 30 additions & 24 deletions src/PIL/TiffImagePlugin.py
Expand Up @@ -437,35 +437,41 @@ class ImageFileDirectory_v2(MutableMapping):

Data Structures:

* self.tagtype = {}
* ``self.tagtype = {}``

* Key: numerical tiff tag number
radarhere marked this conversation as resolved.
Show resolved Hide resolved
* Value: integer corresponding to the data type from
~PIL.TiffTags.TYPES`
:py:data:`.TiffTags.TYPES`

.. versionadded:: 3.0.0
"""
.. versionadded:: 3.0.0

"""
Documentation:

'internal' data structures:
* self._tags_v2 = {} Key: numerical tiff tag number
Value: decoded data, as tuple for multiple values
* self._tagdata = {} Key: numerical tiff tag number
Value: undecoded byte string from file
* self._tags_v1 = {} Key: numerical tiff tag number
Value: decoded data in the v1 format

Tags will be found in the private attributes self._tagdata, and in
self._tags_v2 once decoded.

self.legacy_api is a value for internal use, and shouldn't be
changed from outside code. In cooperation with the
ImageFileDirectory_v1 class, if legacy_api is true, then decoded
tags will be populated into both _tags_v1 and _tags_v2. _tags_v2
will be used if this IFD is used in the TIFF save routine. Tags
should be read from _tags_v1 if legacy_api == true.
'internal' data structures:
radarhere marked this conversation as resolved.
Show resolved Hide resolved

* ``self._tags_v2 = {}``

* Key: numerical tiff tag number
radarhere marked this conversation as resolved.
Show resolved Hide resolved
* Value: decoded data, as tuple for multiple values

* ``self._tagdata = {}``

* Key: numerical tiff tag number
radarhere marked this conversation as resolved.
Show resolved Hide resolved
* Value: undecoded byte string from file

* ``self._tags_v1 = {}``

* Key: numerical tiff tag number
radarhere marked this conversation as resolved.
Show resolved Hide resolved
* Value: decoded data in the v1 format

Tags will be found in the private attributes ``self._tagdata``, and in
``self._tags_v2`` once decoded.

``self.legacy_api`` is a value for internal use, and shouldn't be changed
from outside code. In cooperation with
:py:class:`~PIL.TiffImagePlugin.ImageFileDirectory_v1`, if ``legacy_api``
is true, then decoded tags will be populated into both ``_tags_v1`` and
``_tags_v2``. ``_tags_v2`` will be used if this IFD is used in the TIFF
save routine. Tags should be read from ``_tags_v1`` if
``legacy_api == true``.

"""

Expand Down