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

Function _IfdEntryFactory

src/docx/image/tiff.py:171–182  ·  view source on GitHub ↗

Return an |_IfdEntry| subclass instance containing the value of the directory entry at `offset` in `stream_rdr`.

(stream_rdr, offset)

Source from the content-addressed store, hash-verified

169
170
171def _IfdEntryFactory(stream_rdr, offset):
172 """Return an |_IfdEntry| subclass instance containing the value of the directory
173 entry at `offset` in `stream_rdr`."""
174 ifd_entry_classes = {
175 TIFF_FLD.ASCII: _AsciiIfdEntry,
176 TIFF_FLD.SHORT: _ShortIfdEntry,
177 TIFF_FLD.LONG: _LongIfdEntry,
178 TIFF_FLD.RATIONAL: _RationalIfdEntry,
179 }
180 field_type = stream_rdr.read_short(offset, 2)
181 EntryCls = ifd_entry_classes.get(field_type, _IfdEntry)
182 return EntryCls.from_stream(stream_rdr, offset)
183
184
185class _IfdEntry:

Calls 3

read_shortMethod · 0.80
getMethod · 0.45
from_streamMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…