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

Method _parse_value

src/docx/image/tiff.py:278–289  ·  view source on GitHub ↗

Return the rational (numerator / denominator) value at `value_offset` in `stream_rdr` as a floating-point number. Only supports single values at present.

(cls, stream_rdr, offset, value_count, value_offset)

Source from the content-addressed store, hash-verified

276
277 @classmethod
278 def _parse_value(cls, stream_rdr, offset, value_count, value_offset):
279 """Return the rational (numerator / denominator) value at `value_offset` in
280 `stream_rdr` as a floating-point number.
281
282 Only supports single values at present.
283 """
284 if value_count == 1:
285 numerator = stream_rdr.read_long(value_offset)
286 denominator = stream_rdr.read_long(value_offset, 4)
287 return numerator / denominator
288 else: # pragma: no cover
289 return "Multi-value Rational NOT IMPLEMENTED"

Callers

nothing calls this directly

Calls 1

read_longMethod · 0.80

Tested by

no test coverage detected