TiffTags¶
- final class tifffile.TiffTags¶
Multidict-like interface to TiffTag instances in TiffPage.
Differences to a regular dict:
values are instances of
TiffTag
.keys are
TiffTag.code
(int).multiple values can be stored per key.
can be indexed by
TiffTag.name
(str), slower than by key.iter() returns values instead of keys.
values() and items() contain all values sorted by offset.
len() returns number of all values.
get() takes optional index argument.
some functions are not implemented, such as, update and pop.
- keys()¶
Return codes of all tags.
- Return type:
list[int]
- items()¶
Return all (code, tag) pairs in order tags are stored in file.
- Return type:
list[tuple[int, TiffTag]]
- valueof(key, /, default=None, index=None)¶
Return value of tag by code or name if exists, else default.
- Parameters:
key (int | str) – Code or name of tag to return.
default (Any) – Another value to return if specified tag is corrupted or not found.
index (int | None) – Specifies tag in case of multiple tags with identical code. The default is the first tag.
- Return type:
Any
- get(key, /, default=None, index=None)¶
Return tag by code or name if exists, else default.