jpeg
jpeg
¶
Objects related to parsing headers of JPEG image streams.
Includes both JFIF and Exif sub-formats.
Jpeg
¶
Bases: BaseImageHeader
Base class for JFIF and EXIF subclasses.
Source code in src/docx/image/image.py
Exif
¶
Bases: Jpeg
Image header parser for Exif image format.
Source code in src/docx/image/image.py
from_stream
classmethod
¶
Return Exif instance having header properties parsed from Exif image in
stream.
Source code in src/docx/image/jpeg.py
Jfif
¶
Bases: Jpeg
Image header parser for JFIF image format.
Source code in src/docx/image/image.py
from_stream
classmethod
¶
Return a Jfif instance having header properties parsed from image in
stream.
Source code in src/docx/image/jpeg.py
_JfifMarkers
¶
Sequence of markers in a JPEG file, perhaps truncated at first SOS marker for performance reasons.
Source code in src/docx/image/jpeg.py
from_stream
classmethod
¶
Return a _JfifMarkers instance containing a _JfifMarker subclass instance
for each marker in stream.
Source code in src/docx/image/jpeg.py
_MarkerParser
¶
Service class that knows how to parse a JFIF stream and iterate over its markers.
Source code in src/docx/image/jpeg.py
from_stream
classmethod
¶
Return a _MarkerParser instance to parse JFIF markers from stream.
iter_markers
¶
Generate a (marker_code, segment_offset) 2-tuple for each marker in the JPEG
stream, in the order they occur in the stream.
Source code in src/docx/image/jpeg.py
_MarkerFinder
¶
Service class that knows how to find the next JFIF marker in a stream.
Source code in src/docx/image/jpeg.py
from_stream
classmethod
¶
Return a _MarkerFinder instance to find JFIF markers in stream.
next
¶
Return a (marker_code, segment_offset) 2-tuple identifying and locating the
first marker in stream occuring after offset start.
The returned segment_offset points to the position immediately following the
2-byte marker code, the start of the marker segment, for those markers that have
a segment.
Source code in src/docx/image/jpeg.py
_Marker
¶
Base class for JFIF marker classes.
Represents a marker and its segment occuring in a JPEG byte stream.
Source code in src/docx/image/jpeg.py
marker_code
property
¶
The single-byte code that identifies the type of this marker, e.g. 'à'
for start of image (SOI).
from_stream
classmethod
¶
Return a generic _Marker instance for the marker at offset in stream
having marker_code.
Source code in src/docx/image/jpeg.py
_App0Marker
¶
Bases: _Marker
Represents a JFIF APP0 marker segment.
Source code in src/docx/image/jpeg.py
horz_dpi
property
¶
Horizontal dots per inch specified in this marker, defaults to 72 if not specified.
vert_dpi
property
¶
Vertical dots per inch specified in this marker, defaults to 72 if not specified.
from_stream
classmethod
¶
Return an _App0Marker instance for the APP0 marker at offset in
stream.
Source code in src/docx/image/jpeg.py
_App1Marker
¶
Bases: _Marker
Represents a JFIF APP1 (Exif) marker segment.
Source code in src/docx/image/jpeg.py
horz_dpi
property
¶
Horizontal dots per inch specified in this marker, defaults to 72 if not specified.
vert_dpi
property
¶
Vertical dots per inch specified in this marker, defaults to 72 if not specified.
orientation
property
¶
EXIF Orientation specified in this marker, 1 if it specifies none.
from_stream
classmethod
¶
Extract the horizontal and vertical dots-per-inch value from the APP1 header
at offset in stream.
Source code in src/docx/image/jpeg.py
_SofMarker
¶
Bases: _Marker
Represents a JFIF start of frame (SOFx) marker segment.
Source code in src/docx/image/jpeg.py
from_stream
classmethod
¶
Return an _SofMarker instance for the SOFn marker at offset in stream.
Source code in src/docx/image/jpeg.py
_MarkerFactory
¶
Return _Marker or subclass instance appropriate for marker at offset in
stream having marker_code.