Return an |_IfdEntry| subclass instance containing the value of the directory entry at `offset` in `stream_rdr`.
(stream_rdr, offset)
| 169 | |
| 170 | |
| 171 | def _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 | |
| 185 | class _IfdEntry: |
searching dependent graphs…