Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/xcoder-es/media-cleaner-pro/llms.txt

Use this file to discover all available pages before exploring further.

MediaCleaner Pro reads all of its settings from a .env file located in the same directory as the binary. On first run the file is created automatically with sensible defaults so you can start immediately without touching any configuration. When the binary starts, it loads the file using dotenvy, which means every setting can also be overridden by a real environment variable if you prefer to manage configuration through your shell or a process manager.

Default Configuration File

The file below shows every supported variable with its default value. This is the content of the .env.example file shipped in the repository.
# MediaCleaner Pro Configuration
RUST_LOG=info
SERVER_HOST=127.0.0.1
SERVER_PORT=8080

# Paths
SOURCE_DIR=./data/source
DEST_DIR=./data/output

# Processing
HAMMING_THRESHOLD=4
MIN_WIDTH=100
MIN_HEIGHT=100
WORKER_THREADS=0

# Temporal (optional)
TEMPORAL_HOST=localhost:7233
TEMPORAL_NAMESPACE=default
TEMPORAL_TASK_QUEUE=mediacleaner

# Supabase (optional — enable with --features supabase)
SUPABASE_URL=
SUPABASE_KEY=

Variable Reference

Server

SERVER_HOST
string
default:"127.0.0.1"
The IP address the HTTP server binds to. The default 127.0.0.1 makes the UI and API accessible only from the local machine. Set to 0.0.0.0 to accept connections on all interfaces — useful when running on a headless server and accessing the UI from another device on the same network.
SERVER_PORT
number
default:"8080"
The TCP port the HTTP server listens on. Change this if port 8080 is already in use on your system.

Paths

SOURCE_DIR
string
default:"./data/source"
The directory MediaCleaner Pro scans for input images. Accepts both relative paths (resolved from the binary’s working directory) and absolute paths. Point this at an existing photo library to process files in place without copying them first.
DEST_DIR
string
default:"./data/output"
The root output directory where processed files are written. MediaCleaner Pro creates the full subdirectory tree (duplicates/, categories/, quality/, etc.) inside this path automatically.
DB_PATH
string
default:"./mediacleaner.db"
File path for the SQLite database used to track processing state, file hashes, and job history. The database is created on first run. Changing this path between runs starts with a fresh database.

Processing

HAMMING_THRESHOLD
number
default:"4"
Controls perceptual duplicate detection sensitivity. See the Hamming Threshold section below for a full explanation. Valid range is 064.
MIN_WIDTH
number
default:"100"
Minimum image width in pixels. Images whose width is strictly below this value are classified as tiny and moved to rejected/tiny/. Set to 0 to disable width-based rejection.
MIN_HEIGHT
number
default:"100"
Minimum image height in pixels. Images whose height is strictly below this value are classified as tiny and moved to rejected/tiny/. Set to 0 to disable height-based rejection.
WORKER_THREADS
number
default:"0"
Number of threads used for parallel image processing via Rayon. The default value of 0 instructs MediaCleaner Pro to use all logical CPU cores available on the host machine. Set an explicit positive integer to cap CPU usage — for example, set 4 on an 8-core machine to leave headroom for other workloads.

Logging

RUST_LOG
string
default:"info"
Log verbosity level, consumed by the tracing-subscriber crate. Accepted values in increasing verbosity order: error, warn, info, debug, trace. Use debug or trace when reporting a bug or investigating unexpected pipeline behaviour. Module-level filters such as mediacleaner_pro=debug,tower_http=warn are also supported.

Temporal (Optional)

TEMPORAL_HOST
string
Address of the Temporal server, for example localhost:7233. This variable is optional — if unset, Temporal workflow orchestration is disabled and MediaCleaner Pro runs in standalone mode.
TEMPORAL_NAMESPACE
string
default:"default"
The Temporal namespace to use for workflow execution.
TEMPORAL_TASK_QUEUE
string
default:"mediacleaner"
The Temporal task queue name the worker registers on and polls.

Supabase (Optional)

SUPABASE_URL
string
The URL of your Supabase project, e.g. https://your-project.supabase.co. Optional — only used when the binary is compiled with --features supabase.
SUPABASE_KEY
string
Your Supabase project’s anonymous (public) API key. Optional — only used when the binary is compiled with --features supabase.
SUPABASE_SERVICE_KEY
string
Your Supabase project’s service role key, used for privileged server-side operations. Optional — only used when the binary is compiled with --features supabase.
The TEMPORAL_* and SUPABASE_* variables are optional integration hooks. TEMPORAL_* variables are read from the environment but Temporal orchestration is only active when a TEMPORAL_HOST is provided; without it, MediaCleaner Pro runs in standalone mode. SUPABASE_* variables only take effect when the binary is compiled with cargo build --release --features supabase. Pre-built release binaries on GitHub do not include the Supabase feature.

Hamming Threshold

The HAMMING_THRESHOLD variable is the most impactful tuning knob in MediaCleaner Pro. It governs how visually similar two images must be before they are classified as perceptual duplicates and moved to duplicates/perceptual/. Under the hood, MediaCleaner Pro computes a dHash (difference hash) for every image — a compact 64-bit fingerprint that encodes the relative brightness gradient across the image. The Hamming distance between two hashes counts the number of bit positions where they differ. A smaller distance means the images look more alike.
ThresholdBehaviour
0Only images with an identical pixel-level hash match. Equivalent to exact perceptual matching.
4Default. Catches near-identical shots — same scene, minor exposure or compression differences.
10Allows significant variation. May flag images that share composition but differ in content.
Practical guidance:
  • If you are processing RAW exports or burst shots from a single session, the default of 4 works well.
  • If you want to be conservative and only remove obvious duplicates, lower the value to 2 or 3.
  • Raise the value above 6 only if you deliberately want to collapse visually similar-but-not-identical images (e.g. merging near-duplicate product shots).
Changing SOURCE_DIR or DEST_DIR in the .env file requires a full restart of the binary. MediaCleaner Pro resolves these paths at startup and caches them for the lifetime of the process. Edits made while the server is running will not be picked up until the next launch.

Build docs developers (and LLMs) love