Skip to main content

Crate photofold

Crate photofold 

Source
Expand description

photofold: merge photo folders, remove duplicates, keep the best copy.

The program is a pipeline. pipeline::run calls each stage once, in order, and every stage lives in its own module:

scanner -> exact -> quality -> planner -> copier -> report

Two rules shape the whole design:

Modules§

analyze
The parallel analysis stage: metadata for every file, a fingerprint for every image.
apple
Reading Apple’s Live Photo content identifier.
bucketing
Choosing which pairs of files are worth comparing.
cache
Remembering what was learned about a file, so a second run is nearly free.
cli
Command-line parsing and validation.
copier
Placing the winning files in the output folder.
decode
Turning a photo on disk into a small picture, as cheaply as the format allows.
error
Error types.
exact
Byte-for-byte duplicate detection.
fingerprint
Building a small, comparable description of what a picture looks like.
grouping
Turning pairwise “these two are the same” decisions into duplicate groups.
isobmff
A minimal reader for the ISO base media file format.
live_photo
Keeping Live Photos in one piece.
matching
Deciding whether two files are the same photo.
metadata
Reading metadata without decoding pixels.
models
Core data types shared by every pipeline stage.
pipeline
Stage-by-stage orchestration of one run.
planner
Choosing a destination path for every file that will be kept.
progress
Progress reporting.
quality
Deciding which copy of a photo to keep.
report
The run report: JSON, CSV, and the summary printed at the end.
scanner
Recursive scanning of the source folders.
timing
Per-stage timing, so it is possible to see where a long run spends its time.
video
Reading what a movie file is made of.