ORIONIS API REFERENCE

THE ORIONIS API

Build with clarity.

Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.

module documentation

Read supported raster headers without decoding image pixels.

Function _jpeg_frame Read dimensions from a structurally complete JPEG frame segment.
Function _probe_bmp Read the dimensions stored in a BMP information header.
Function _probe_gif Read the dimensions stored in a GIF logical screen descriptor.
Function _probe_jpeg Walk the JPEG segments until a start-of-frame marker is found.
Function _probe_png Read the dimensions stored in a PNG IHDR chunk.
Function _probe_webp Read the dimensions of the lossy, lossless or extended WebP bitstream.
Function probe_image Identify a raster image and read its dimensions from the header.
Constant _BMP_CORE_SIZE DIB header size identifying unsigned sixteen-bit CORE dimensions.
Constant _BMP_HEADER Bmp header value used by image_probe.
Constant _BMP_INFO_PREFIX Minimum DIB header size carrying thirty-two-bit dimensions.
Constant _BMP_SIGNATURE Bmp signature value used by image_probe.
Constant _GIF_HEADER Gif header value used by image_probe.
Constant _GIF_SIGNATURES Gif signatures definitions used by image_probe.
Constant _JPEG_FILL Byte introducing every JPEG marker.
Constant _JPEG_LENGTH_SIZE Length-field bytes included in every variable-length JPEG segment.
Constant _JPEG_SIGNATURE Jpeg signature value used by image_probe.
Constant _JPEG_SOF_BASE SOF segment bytes preceding the three-byte component entries.
Constant _PNG_HEADER Minimum header length required by each probe before unpacking.
Constant _PNG_SIGNATURE Magic numbers identifying every supported raster format.
Constant _PROBES Probes are ordered by signature cost; each one rejects foreign formats first.
Constant _SOF_MARKERS JPEG start-of-frame markers; their payload carries the image dimensions.
Constant _STANDALONE_MARKERS JPEG markers that carry no payload and are skipped two bytes at a time.
Constant _WEBP_FRAME_HEADER Minimum prefix carrying VP8 or VP8X dimensions.
Constant _WEBP_FRAME_SIZE Bytes required in the VP8 or VP8X dimension prefix.
Constant _WEBP_HEADER Minimum RIFF and first-chunk headers needed to identify WebP storage.
Constant _WEBP_LOSSLESS_HEADER Minimum prefix carrying the VP8L signature and packed dimensions.
Constant _WEBP_LOSSLESS_SIGNATURE Signature byte that must begin a lossless WebP bitstream.
Constant _WEBP_LOSSLESS_SIZE Bytes required in the VP8L signature and dimension prefix.
Constant _WEBP_MASK Mask isolating the 14-bit dimensions stored in WebP bitstreams.
def _jpeg_frame(data: bytes, index: int, segment_size: int) -> tuple[str, int, int] | None: (source)

Read dimensions from a structurally complete JPEG frame segment.

Parameters
data:bytesHeader content containing the complete segment.
index:intOffset of the segment marker.
segment_size:intSegment length, including its two-byte length field.
Returns
tuple[str, int, int] | NoneJPEG format and dimensions, or None for an invalid component layout.
def _probe_bmp(data: bytes) -> tuple[str, int, int] | None: (source)

Read the dimensions stored in a BMP information header.

Parameters
data:bytesRaw image content.
Returns
tuple[str, int, int] | NoneFormat name with width and height, or None when not a BMP.
def _probe_gif(data: bytes) -> tuple[str, int, int] | None: (source)

Read the dimensions stored in a GIF logical screen descriptor.

Parameters
data:bytesRaw image content.
Returns
tuple[str, int, int] | NoneFormat name with width and height, or None when not a GIF.
def _probe_jpeg(data: bytes) -> tuple[str, int, int] | None: (source)

Walk the JPEG segments until a start-of-frame marker is found.

Parameters
data:bytesRaw image content.
Returns
tuple[str, int, int] | NoneFormat name with width and height, or None when not a JPEG.
def _probe_png(data: bytes) -> tuple[str, int, int] | None: (source)

Read the dimensions stored in a PNG IHDR chunk.

Parameters
data:bytesRaw image content.
Returns
tuple[str, int, int] | NoneFormat name with width and height, or None when not a PNG.
def _probe_webp(data: bytes) -> tuple[str, int, int] | None: (source)

Read the dimensions of the lossy, lossless or extended WebP bitstream.

Parameters
data:bytesRaw image content.
Returns
tuple[str, int, int] | NoneFormat name with width and height, or None when not a WebP.
def probe_image(data: bytes) -> tuple[str, int, int] | None: (source)

Identify a raster image and read its dimensions from the header.

Parameters
data:bytesRaw image content.
Returns
tuple[str, int, int] | NoneFormat name with width and height, or None when the content is not a supported header or either dimension is zero or negative. Inspect only format metadata; do not decode pixels or verify compressed content.
_BMP_CORE_SIZE: int = (source)

DIB header size identifying unsigned sixteen-bit CORE dimensions.

Value
12
_BMP_HEADER: int = (source)

Bmp header value used by image_probe.

Value
26
_BMP_INFO_PREFIX: int = (source)

Minimum DIB header size carrying thirty-two-bit dimensions.

Value
16
_BMP_SIGNATURE: bytes = (source)

Bmp signature value used by image_probe.

Value
b'BM'
_GIF_HEADER: int = (source)

Gif header value used by image_probe.

Value
10
_GIF_SIGNATURES: tuple[bytes, ...] = (source)

Gif signatures definitions used by image_probe.

Value
(b'GIF87a', b'GIF89a')
_JPEG_FILL: int = (source)

Byte introducing every JPEG marker.

Value
255
_JPEG_LENGTH_SIZE: int = (source)

Length-field bytes included in every variable-length JPEG segment.

Value
2
_JPEG_SIGNATURE: bytes = (source)

Jpeg signature value used by image_probe.

Value
b'\xff\xd8'
_JPEG_SOF_BASE: int = (source)

SOF segment bytes preceding the three-byte component entries.

Value
8
_PNG_HEADER: int = (source)

Minimum header length required by each probe before unpacking.

Value
24
_PNG_SIGNATURE: bytes = (source)

Magic numbers identifying every supported raster format.

Value
b'''\x89PNG\r
\x1a
'''

Probes are ordered by signature cost; each one rejects foreign formats first.

Value
(_probe_png, _probe_jpeg, _probe_gif, _probe_bmp, _probe_webp)
_SOF_MARKERS = (source)

JPEG start-of-frame markers; their payload carries the image dimensions.

Value
frozenset(set([192, 193, 194, 195, 197, 198, 199, 201, 202, 203, 205, 206, 207])↵
)
_STANDALONE_MARKERS = (source)

JPEG markers that carry no payload and are skipped two bytes at a time.

Value
frozenset(set([1, *range(208, 216)]))
_WEBP_FRAME_HEADER: int = (source)

Minimum prefix carrying VP8 or VP8X dimensions.

Value
30
_WEBP_FRAME_SIZE: int = (source)

Bytes required in the VP8 or VP8X dimension prefix.

Value
10
_WEBP_HEADER: int = (source)

Minimum RIFF and first-chunk headers needed to identify WebP storage.

Value
20
_WEBP_LOSSLESS_HEADER: int = (source)

Minimum prefix carrying the VP8L signature and packed dimensions.

Value
25
_WEBP_LOSSLESS_SIGNATURE: int = (source)

Signature byte that must begin a lossless WebP bitstream.

Value
47
_WEBP_LOSSLESS_SIZE: int = (source)

Bytes required in the VP8L signature and dimension prefix.

Value
5
_WEBP_MASK: int = (source)

Mask isolating the 14-bit dimensions stored in WebP bitstreams.

Value
16383