tiff
tiff
¶
Tiff
¶
Bases: BaseImageHeader
Image header parser for TIFF images.
Handles both big and little endian byte ordering.
Source code in src/docx/image/image.py
content_type
property
¶
Return the MIME type of this TIFF image, unconditionally the string
image/tiff.
from_stream
classmethod
¶
Return a Tiff instance containing the properties of the TIFF image in
stream.
Source code in src/docx/image/tiff.py
_TiffParser
¶
Parses a TIFF image stream to extract the image properties found in its main image file directory (IFD)
Source code in src/docx/image/tiff.py
horz_dpi
property
¶
The horizontal dots per inch value calculated from the XResolution and ResolutionUnit tags of the IFD; defaults to 72 if those tags are not present.
vert_dpi
property
¶
The vertical dots per inch value calculated from the XResolution and ResolutionUnit tags of the IFD; defaults to 72 if those tags are not present.
orientation
property
¶
The Orientation tag value, or 1 when the tag is absent or unparseable.
1 means the stored pixels are already in display order, which is what every value outside the documented 1..8 range is treated as: an orientation nobody can act on is better ignored than guessed at.
px_height
property
¶
The number of stacked rows of pixels in the image, None if the IFD contains
no ImageLength tag, the expected case when the TIFF is embeded in an Exif
image.
px_width
property
¶
The number of pixels in each row in the image, None if the IFD contains no
ImageWidth tag, the expected case when the TIFF is embeded in an Exif
image.
parse
classmethod
¶
Return an instance of _TiffParser containing the properties parsed from the
TIFF image in stream.
Source code in src/docx/image/tiff.py
_IfdEntries
¶
Image File Directory for a TIFF image, having mapping (dict) semantics allowing "tag" values to be retrieved by tag code.
Source code in src/docx/image/tiff.py
from_stream
classmethod
¶
Return a new _IfdEntries instance parsed from stream starting at
offset.
Source code in src/docx/image/tiff.py
get
¶
Return value of IFD entry having tag matching tag_code, or default if no
matching tag found.
_IfdParser
¶
_IfdEntry
¶
Base class for IFD entry classes.
Subclasses are differentiated by value type, e.g. ASCII, long int, etc.
Source code in src/docx/image/tiff.py
from_stream
classmethod
¶
Return an _IfdEntry subclass instance containing the tag and value of the
tag parsed from stream_rdr at offset.
Note this method is common to all subclasses. Override the _parse_value()
method to provide distinctive behavior based on field type.
Source code in src/docx/image/tiff.py
_AsciiIfdEntry
¶
_ShortIfdEntry
¶
_LongIfdEntry
¶
_RationalIfdEntry
¶
_IfdEntryFactory
¶
Return an _IfdEntry subclass instance containing the value of the directory
entry at offset in stream_rdr.