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

Method from_offset

src/docx/image/png.py:209–214  ·  view source on GitHub ↗

Return an _IHDRChunk instance containing the image dimensions extracted from the IHDR chunk in `stream` at `offset`.

(cls, chunk_type, stream_rdr, offset)

Source from the content-addressed store, hash-verified

207
208 @classmethod
209 def from_offset(cls, chunk_type, stream_rdr, offset):
210 """Return an _IHDRChunk instance containing the image dimensions extracted from
211 the IHDR chunk in `stream` at `offset`."""
212 px_width = stream_rdr.read_long(offset)
213 px_height = stream_rdr.read_long(offset, 4)
214 return cls(chunk_type, px_width, px_height)
215
216 @property
217 def px_width(self):

Callers

nothing calls this directly

Calls 1

read_longMethod · 0.80

Tested by

no test coverage detected