MCPcopy Index your code
hub / github.com/python-openxml/python-docx / from_stream

Method from_stream

src/docx/image/tiff.py:24–34  ·  view source on GitHub ↗

Return a |Tiff| instance containing the properties of the TIFF image in `stream`.

(cls, stream)

Source from the content-addressed store, hash-verified

22
23 @classmethod
24 def from_stream(cls, stream):
25 """Return a |Tiff| instance containing the properties of the TIFF image in
26 `stream`."""
27 parser = _TiffParser.parse(stream)
28
29 px_width = parser.px_width
30 px_height = parser.px_height
31 horz_dpi = parser.horz_dpi
32 vert_dpi = parser.vert_dpi
33
34 return cls(px_width, px_height, horz_dpi, vert_dpi)
35
36
37class _TiffParser:

Callers 2

parseMethod · 0.45
_IfdEntryFactoryFunction · 0.45

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected