Skip to main content

Module image

Module image 

Source
Expand description

Image content extractor.

Extracts image files and prepares them for embedding. Optionally generates captions using a vision model.

Re-exportsยง

use crate::vision::ImageCaptioner; ๐Ÿ”’
use async_trait::async_trait; ๐Ÿ”’
use image::GenericImageView; ๐Ÿ”’
use std::io::Cursor; ๐Ÿ”’
use ragfs_core::ContentElement; ๐Ÿ”’
use ragfs_core::ContentExtractor; ๐Ÿ”’
use ragfs_core::ContentMetadataInfo; ๐Ÿ”’
use ragfs_core::ExtractError; ๐Ÿ”’
use ragfs_core::ExtractedContent; ๐Ÿ”’
use ragfs_core::ExtractedImage; ๐Ÿ”’
use std::path::Path; ๐Ÿ”’
use std::sync::Arc; ๐Ÿ”’
use tracing::debug; ๐Ÿ”’
use tracing::warn; ๐Ÿ”’

Structsยง

ImageExtractor
Extractor for image files.

Constantsยง

MAX_IMAGE_PIXELS
Maximum decoded pixels accepted before captioning or embedding.

Functionsยง

checked_dimensions
Read dimensions without allocating a decoded bitmap.
decode_image_metadata ๐Ÿ”’
Decode image to get dimensions and format.
mime_type_from_extension ๐Ÿ”’
Get MIME type from file extension.