Skip to main content

Module image_processing

Module image_processing 

Source
Expand description

Image processing utilities

Re-exports and high-level wrappers for image processing.

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.
read_image_from_url
Reads an image from a URL and converts it to base64 format