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

Method from_stream

src/docx/image/jpeg.py:51–61  ·  view source on GitHub ↗

Return a |Jfif| instance having header properties parsed from image in `stream`.

(cls, stream)

Source from the content-addressed store, hash-verified

49
50 @classmethod
51 def from_stream(cls, stream):
52 """Return a |Jfif| instance having header properties parsed from image in
53 `stream`."""
54 markers = _JfifMarkers.from_stream(stream)
55
56 px_width = markers.sof.px_width
57 px_height = markers.sof.px_height
58 horz_dpi = markers.app0.horz_dpi
59 vert_dpi = markers.app0.vert_dpi
60
61 return cls(px_width, px_height, horz_dpi, vert_dpi)
62
63
64class _JfifMarkers:

Callers

nothing calls this directly

Calls 1

from_streamMethod · 0.45

Tested by

no test coverage detected