smelt.image¶
Tier: Host - Available in every runtime, including headless mode.
Visibility: Public - Stable Lua API intended for user config and plugins.
Image file detection and base64 data-URL loading.
smelt.image.data_url_from_bytes¶
Encode raw bytes as a base64 data: URL with the given mime type.
smelt.image.is_image_file¶
Return true if p looks like an image file (matched by extension/sniffing).
smelt.image.label_from_path¶
Return a display label for an image path.
smelt.image.mime_from_path¶
Return the image MIME type inferred from p's extension.
smelt.image.read_as_data_url¶
Read the image at p and encode it as a data: URL. Returns (url, nil) on success or (nil, err_string) on failure.
smelt.image.read_as_data_url_async¶
Read and base64-encode an image off the main thread. Same return shape as
smelt.image.read_as_data_url.