photostax_core/lib.rs
1//! # photostax-core
2//!
3//! Unified photo stack library for Epson FastFoto repositories.
4//!
5//! [](https://github.com/JeromySt/photostax)
6//!
7//! ## Overview
8//!
9//! Epson FastFoto scanners produce multiple files per scanned photo:
10//!
11//! | File Pattern | Description |
12//! |--------------|-------------|
13//! | `<name>.jpg` or `<name>.tif` | Original front scan |
14//! | `<name>_a.jpg` or `<name>_a.tif` | Enhanced version (color-corrected) **or** back of photo |
15//! | `<name>_b.jpg` or `<name>_b.tif` | Back of the photo (always) |
16//!
17//! This library groups these files into [`PhotoStack`] objects and provides a
18//! [`Repository`] trait for accessing them from various storage backends.
19//! **Both JPEG and TIFF formats are fully supported.**
20//!
21//! ## Quick Start
22//!
23//! ```rust,no_run
24//! use photostax_core::backends::local::LocalRepository;
25//! use photostax_core::stack_manager::StackManager;
26//! use photostax_core::photo_stack::ScannerProfile;
27//! use photostax_core::search::SearchQuery;
28//!
29//! // Create a StackManager with a local repository
30//! let repo = LocalRepository::new("/path/to/photos");
31//! let mut mgr = StackManager::single(Box::new(repo), ScannerProfile::Auto).unwrap();
32//!
33//! // Query all stacks (auto-scans on first call)
34//! let mut result = mgr.query(None, Some(20), None, None).unwrap();
35//! println!("{} stacks across {} pages", result.total_count(), result.page_count());
36//!
37//! // Iterate current page
38//! for stack in result.current_page() {
39//! println!("Photo: {} ({})", stack.name(), stack.id());
40//! }
41//!
42//! // Navigate to next page
43//! while let Some(page) = result.next_page() {
44//! for stack in page {
45//! println!("Photo: {}", stack.name());
46//! }
47//! }
48//! ```
49//!
50//! ## Module Organization
51//!
52//! - [`photo_stack`] — Core [`PhotoStack`] and [`Metadata`] types representing grouped photos
53//! - [`classify`] — Image analysis for classifying ambiguous `_a` scans as front or back
54//! - [`repository`] — [`Repository`] trait for storage backend abstraction
55//! - [`scanner`] — Directory scanning and file grouping logic
56//! - [`search`] — Query builder for filtering photo stacks by metadata
57//! - [`snapshot`] — Point-in-time snapshot for consistent pagination
58//! - [`metadata`] — EXIF, XMP, and sidecar database support
59//! - [`backends`] — Storage backend implementations (local filesystem, cloud planned)
60//!
61//! ## Features
62//!
63//! - **Multi-format support**: JPEG (`.jpg`, `.jpeg`) and TIFF (`.tif`, `.tiff`)
64//! - **Metadata merging**: Combines EXIF, XMP, and custom sidecar database tags
65//! - **Search & filter**: Query stacks by metadata with a fluent builder API
66//! - **Extensible backends**: Pluggable [`Repository`] trait for different storage systems
67//!
68//! ## License
69//!
70//! Licensed under either of [Apache License, Version 2.0](https://github.com/JeromySt/photostax/blob/main/LICENSE-APACHE)
71//! or [MIT license](https://github.com/JeromySt/photostax/blob/main/LICENSE-MIT) at your option.
72//!
73//! [`PhotoStack`]: photo_stack::PhotoStack
74//! [`Metadata`]: photo_stack::Metadata
75//! [`Repository`]: repository::Repository
76
77#![warn(missing_docs)]
78
79pub mod backends;
80pub mod classifier;
81pub mod classify;
82pub mod events;
83pub mod file_access;
84pub mod hashing;
85pub mod image_handle;
86pub mod metadata;
87pub mod metadata_handle;
88pub mod photo_stack;
89pub mod query_result;
90pub mod repository;
91pub mod scanner;
92pub mod search;
93pub mod snapshot;
94pub mod stack_manager;