png
png
¶
Png
¶
Bases: BaseImageHeader
Image header parser for PNG images.
Source code in src/docx/image/image.py
content_type
property
¶
MIME content type for this image, unconditionally image/png for PNG
images.
from_stream
classmethod
¶
Return a Png instance having header properties parsed from image in
stream.
Source code in src/docx/image/png.py
_PngParser
¶
Parses a PNG image stream to extract the image properties found in its chunks.
Source code in src/docx/image/png.py
horz_dpi
property
¶
Integer dots per inch for the width of this image.
Defaults to 72 when not present in the file, as is often the case.
vert_dpi
property
¶
Integer dots per inch for the height of this image.
Defaults to 72 when not present in the file, as is often the case.
parse
classmethod
¶
Return a _PngParser instance containing the header properties parsed from
the PNG image in stream.
_Chunks
¶
_ChunkParser
¶
Extracts chunks from a PNG image stream.
Source code in src/docx/image/png.py
from_stream
classmethod
¶
Return a _ChunkParser instance that can extract the chunks from the PNG
image in stream.
_Chunk
¶
Base class for specific chunk types.
Also serves as the default chunk type.
Source code in src/docx/image/png.py
from_offset
classmethod
¶
_IHDRChunk
¶
Bases: _Chunk
IHDR chunk, contains the image dimensions.
Source code in src/docx/image/png.py
from_offset
classmethod
¶
Return an _IHDRChunk instance containing the image dimensions extracted from
the IHDR chunk in stream at offset.
Source code in src/docx/image/png.py
_ChunkFactory
¶
Return a _Chunk subclass instance appropriate to chunk_type parsed from
stream_rdr at offset.