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

Function _ChunkFactory

src/docx/image/png.py:168–176  ·  view source on GitHub ↗

Return a |_Chunk| subclass instance appropriate to `chunk_type` parsed from `stream_rdr` at `offset`.

(chunk_type, stream_rdr, offset)

Source from the content-addressed store, hash-verified

166
167
168def _ChunkFactory(chunk_type, stream_rdr, offset):
169 """Return a |_Chunk| subclass instance appropriate to `chunk_type` parsed from
170 `stream_rdr` at `offset`."""
171 chunk_cls_map = {
172 PNG_CHUNK_TYPE.IHDR: _IHDRChunk,
173 PNG_CHUNK_TYPE.pHYs: _pHYsChunk,
174 }
175 chunk_cls = chunk_cls_map.get(chunk_type, _Chunk)
176 return chunk_cls.from_offset(chunk_type, stream_rdr, offset)
177
178
179class _Chunk:

Callers 2

iter_chunksMethod · 0.85

Calls 2

getMethod · 0.45
from_offsetMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…