Skip to main content

Module process

Module process 

Source
Expand description

Image processing and responsive image generation.

Stage 2 of the Simple Gal build pipeline. Takes the manifest from the scan stage and processes all images to generate responsive sizes and thumbnails.

§Dependencies

Uses the pure Rust imaging backend — no external dependencies required.

§Output Formats

For each source image, generates:

  • Responsive images: Multiple sizes in AVIF format
  • Thumbnails: Fixed aspect ratio crops for gallery grids

§Default Configuration

Responsive sizes: 800px, 1400px, 2080px (on the longer edge)
Quality: 90%
Thumbnail aspect: 4:5 (portrait)
Thumbnail size: 400px (on the short edge)

§Output Structure

processed/
├── manifest.json              # Updated manifest with generated paths
├── 010-Landscapes/
│   ├── 001-dawn-800.avif      # Responsive sizes
│   ├── 001-dawn-1400.avif
│   ├── 001-dawn-2080.avif
│   └── 001-dawn-thumb.avif    # 4:5 center-cropped thumbnail
└── ...

Structs§

GeneratedVariant
InputAlbum
InputImage
InputManifest
Input manifest (from scan stage)
OutputAlbum
OutputImage
OutputManifest
Output manifest (after processing)
ProcessConfig
Configuration for image processing
ProcessResult
Process result containing the output manifest and cache statistics.
VariantInfo
Information about a single processed variant (for progress reporting).

Enums§

ProcessError
ProcessEvent
Progress events emitted during image processing.
VariantStatus
Cache outcome for a single processed variant (for progress reporting).

Functions§

process
process_with_backend
Process images using a specific backend (allows testing with mock).