Module images

Module images 

Source
Expand description

Image loading and processing for markdown-to-pdf conversion.

This module provides functionality to load images from both local paths and remote URLs, with support for relative path resolution and caching.

§Features

  • Load images from local filesystem paths
  • Download images from HTTP(S) URLs
  • Resolve relative paths based on document location
  • Cache downloaded images to avoid repeated downloads

§Example

use markdown2pdf::images::{ImageLoader, ImageFormat};
use std::path::Path;

// Create a loader for a document at a specific location
let loader = ImageLoader::new(Some(Path::new("./document.md")));

// This would fail in doctests since we can't actually load files,
// but shows the intended API:
// let image = loader.load("./images/photo.jpg").await.unwrap();

Structs§

ImageData
Represents loaded image data with metadata.
ImageLoader
Manages loading and caching of images for a document.

Enums§

ImageError
Error types for image operations.
ImageFormat
Represents different image formats supported by the library.