Skip to main content

Module image

Module image 

Source
Expand description

Image processing utilities

Structs§

ImageData
Represents the data from an image file ready for LLM consumption

Functions§

detect_mime_type_from_content_type
Detects MIME type from Content-Type header
detect_mime_type_from_data
Detects MIME type from file data (magic bytes)
detect_mime_type_from_extension
Detects the MIME type based on file extension
encode_to_base64
Encodes binary data to base64
has_supported_image_extension
Validates that the image file path has a supported extension
read_image_file
Reads an image file from the local filesystem and converts it to base64 format.
read_image_file_any_path
Reads an image file from an absolute path (or already validated path) and converts it to base64.