photostax-core
Unified photo stack library for Epson FastFoto repositories — scanning, metadata, and search.
Overview
Epson FastFoto scanners produce multiple files per scanned photo:
| File Pattern | Description |
|---|---|
<name>.jpg or <name>.tif |
Original front scan |
<name>_a.jpg or <name>_a.tif |
Enhanced version (color-corrected) |
<name>_b.jpg or <name>_b.tif |
Back of the photo |
This library groups them into a single PhotoStack abstraction, enabling applications to operate on complete photos rather than individual files.
Installation
Features
- PhotoStack-centric API — all I/O through
stack.original.read(),stack.metadata.write(), etc. - Multi-format support — JPEG (
.jpg,.jpeg) and TIFF (.tif,.tiff) - ImageRef / MetadataRef — lazy, cached accessors for image data and metadata
- Repository trait — pluggable storage backends (local filesystem included)
- SessionManager — multi-repo cache with unified query and pagination
- Search & filter — query stacks by metadata with a fluent builder API
- QueryResult — page-based results with
next_page(),prev_page(), and sub-queries
Quick Start
use LocalRepository;
use StackManager;
use ScannerProfile;
use SearchQuery;
let repo = new;
let mut mgr = single.unwrap;
// Query all stacks — query() auto-scans on first call
let mut result = mgr.query.unwrap;
for stack in result.current_page
// Search with pagination
let query = new.with_has_back;
let mut result = mgr.query.unwrap;
println!;
// Navigate pages
while let Some = result.next_page
API Overview
Core Types
| Type | Description |
|---|---|
PhotoStack |
Grouped photo with original, enhanced, back (ImageRef) and metadata (MetadataRef) |
ImageRef |
Lazy, cached accessor for a single image variant — read(), hash(), dimensions(), rotate() |
MetadataRef |
Lazy accessor for stack metadata — read(), write() |
Metadata |
EXIF, XMP, and custom tags for a photo stack |
Repository |
Trait for storage backend abstraction |
LocalRepository |
Local filesystem implementation |
StackManager |
Multi-repo cache manager (aliased as SessionManager) |
SearchQuery |
Builder for filtering stacks by metadata |
QueryResult |
Page-based query result with next_page(), prev_page(), current_page(), query() sub-queries |
Key Operations
// Create a manager — query() auto-scans on first call
let mut mgr = single?;
// Query with pagination and progress
let mut result = mgr.query?;
// Per-stack image I/O via accessor methods
let stack = result.current_page.first.unwrap;
let mut reader = stack.original_read?; // Read image bytes
let hash = stack.enhanced_hash?; // SHA-256 (cached)
stack.back_rotate?; // Rotate in place
// Per-stack metadata
let meta = stack.metadata_read?; // Lazy load EXIF/XMP/custom
stack.metadata_write?; // Write back
// Page navigation
println!;
while let Some = result.next_page
// Sub-query on existing results
let sub = result.query;
Building from Source
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.