Skip to main content

Crate photostax_core

Crate photostax_core 

Source
Expand description

§photostax-core

Unified photo stack library for Epson FastFoto repositories.

GitHub

§Overview

Epson FastFoto scanners produce multiple files per scanned photo:

File PatternDescription
<name>.jpg or <name>.tifOriginal front scan
<name>_a.jpg or <name>_a.tifEnhanced version (color-corrected) or back of photo
<name>_b.jpg or <name>_b.tifBack of the photo (always)

This library groups these files into PhotoStack objects and provides a Repository trait for accessing them from various storage backends. Both JPEG and TIFF formats are fully supported.

§Quick Start

use photostax_core::backends::local::LocalRepository;
use photostax_core::stack_manager::StackManager;
use photostax_core::photo_stack::ScannerProfile;
use photostax_core::search::SearchQuery;

// Create a StackManager with a local repository
let repo = LocalRepository::new("/path/to/photos");
let mut mgr = StackManager::single(Box::new(repo), ScannerProfile::Auto).unwrap();

// Query all stacks (auto-scans on first call)
let mut result = mgr.query(None, Some(20), None, None).unwrap();
println!("{} stacks across {} pages", result.total_count(), result.page_count());

// Iterate current page
for stack in result.current_page() {
    println!("Photo: {} ({})", stack.name(), stack.id());
}

// Navigate to next page
while let Some(page) = result.next_page() {
    for stack in page {
        println!("Photo: {}", stack.name());
    }
}

§Module Organization

  • photo_stack — Core PhotoStack and Metadata types representing grouped photos
  • classify — Image analysis for classifying ambiguous _a scans as front or back
  • repositoryRepository trait for storage backend abstraction
  • scanner — Directory scanning and file grouping logic
  • search — Query builder for filtering photo stacks by metadata
  • snapshot — Point-in-time snapshot for consistent pagination
  • metadata — EXIF, XMP, and sidecar database support
  • backends — Storage backend implementations (local filesystem, cloud planned)

§Features

  • Multi-format support: JPEG (.jpg, .jpeg) and TIFF (.tif, .tiff)
  • Metadata merging: Combines EXIF, XMP, and custom sidecar database tags
  • Search & filter: Query stacks by metadata with a fluent builder API
  • Extensible backends: Pluggable Repository trait for different storage systems

§License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Modules§

backends
Storage backend implementations.
classifier
Image classifier trait for determining if an ambiguous _a scan is an enhanced front or a back-of-photo image.
classify
Image classification for ambiguous FastFoto _a scans.
events
Event types for the reactive notification cascade.
file_access
File access abstraction with locking semantics.
hashing
Content hashing for duplicate detection and cache invalidation.
image_handle
Image handle trait and ImageRef accessor for per-file I/O operations.
metadata
Image format detection and metadata sub-modules.
metadata_handle
Metadata handle trait and MetadataRef accessor for per-stack metadata I/O.
photo_stack
Photo stack data structures representing grouped FastFoto scans.
query_result
Paginated query result with cursor navigation.
repository
Storage backend abstraction for photo repositories.
scanner
Directory scanning and photo stack grouping.
search
Search and filtering for photo stacks.
snapshot
Point-in-time snapshot for consistent pagination.
stack_manager
Unified cache manager for multiple photo repositories.