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
- Multi-format support — JPEG (
.jpg,.jpeg) and TIFF (.tif,.tiff) - PhotoStack abstraction — Groups front, enhanced, and back scans into a single unit
- Repository trait — Pluggable storage backends (local filesystem included)
- Metadata support — Read EXIF, read/write XMP, and custom sidecar database
- Search & filter — Query stacks by metadata with a fluent builder API
- Pagination — Fetch pages of results by offset and limit for efficient web rendering
Quick Start
use LocalRepository;
use Repository;
let repo = new;
let stacks = repo.scan.unwrap;
for stack in &stacks
API Overview
Core Types
| Type | Description |
|---|---|
PhotoStack |
Represents a grouped photo with original, enhanced, and back scans |
Metadata |
EXIF, XMP, and custom metadata for a photo stack |
Repository |
Trait for storage backend abstraction |
LocalRepository |
Local filesystem implementation |
SearchQuery |
Builder for filtering stacks by metadata |
PaginationParams |
Offset and limit for paginated queries |
PaginatedResult<T> |
A page of results with total count and navigation metadata |
Key Methods
// Scanning
let stacks = repo.scan?; // Discover all photo stacks
let stack = repo.get_stack?; // Get specific stack by ID
// Metadata
let metadata = repo.read_metadata?;
repo.write_metadata?;
// Search
let query = new
.with_text
.with_has_back;
let results = repo.search?;
// Pagination
use ;
let stacks = repo.scan?;
let page = paginate_stacks;
println!;
assert_eq!;
// Read image stream
use Read;
let mut bytes = Vecnew;
repo.read_image?.read_to_end?;
Building from Source
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.