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

Method iter_markers

src/docx/image/jpeg.py:142–152  ·  view source on GitHub ↗

Generate a (marker_code, segment_offset) 2-tuple for each marker in the JPEG `stream`, in the order they occur in the stream.

(self)

Source from the content-addressed store, hash-verified

140 return cls(stream_reader)
141
142 def iter_markers(self):
143 """Generate a (marker_code, segment_offset) 2-tuple for each marker in the JPEG
144 `stream`, in the order they occur in the stream."""
145 marker_finder = _MarkerFinder.from_stream(self._stream)
146 start = 0
147 marker_code = None
148 while marker_code != JPEG_MARKER_CODE.EOI:
149 marker_code, segment_offset = marker_finder.next(start)
150 marker = _MarkerFactory(marker_code, self._stream, segment_offset)
151 yield marker
152 start = segment_offset + marker.segment_length
153
154
155class _MarkerFinder:

Calls 3

_MarkerFactoryFunction · 0.85
nextMethod · 0.80
from_streamMethod · 0.45