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

Method from_stream

src/docx/image/tiff.py:197–208  ·  view source on GitHub ↗

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.

(cls, stream_rdr, offset)

Source from the content-addressed store, hash-verified

195
196 @classmethod
197 def from_stream(cls, stream_rdr, offset):
198 """Return an |_IfdEntry| subclass instance containing the tag and value of the
199 tag parsed from `stream_rdr` at `offset`.
200
201 Note this method is common to all subclasses. Override the ``_parse_value()``
202 method to provide distinctive behavior based on field type.
203 """
204 tag_code = stream_rdr.read_short(offset, 0)
205 value_count = stream_rdr.read_long(offset, 4)
206 value_offset = stream_rdr.read_long(offset, 8)
207 value = cls._parse_value(stream_rdr, offset, value_count, value_offset)
208 return cls(tag_code, value)
209
210 @classmethod
211 def _parse_value(cls, stream_rdr, offset, value_count, value_offset):

Callers

nothing calls this directly

Calls 3

read_shortMethod · 0.80
read_longMethod · 0.80
_parse_valueMethod · 0.45

Tested by

no test coverage detected