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

Method from_offset

src/docx/image/png.py:235–241  ·  view source on GitHub ↗

Return a _pHYsChunk instance containing the image resolution extracted from the pHYs chunk in `stream` at `offset`.

(cls, chunk_type, stream_rdr, offset)

Source from the content-addressed store, hash-verified

233
234 @classmethod
235 def from_offset(cls, chunk_type, stream_rdr, offset):
236 """Return a _pHYsChunk instance containing the image resolution extracted from
237 the pHYs chunk in `stream` at `offset`."""
238 horz_px_per_unit = stream_rdr.read_long(offset)
239 vert_px_per_unit = stream_rdr.read_long(offset, 4)
240 units_specifier = stream_rdr.read_byte(offset, 8)
241 return cls(chunk_type, horz_px_per_unit, vert_px_per_unit, units_specifier)
242
243 @property
244 def horz_px_per_unit(self):

Callers

nothing calls this directly

Calls 2

read_longMethod · 0.80
read_byteMethod · 0.80

Tested by

no test coverage detected