feat: add AppConfig INI-based configuration system

Implements a zero-dependency INI parser for application settings with
[batch], [conversion], and [quality] sections. Includes AppConfig::load(),
write_default(), output_format(), and parsed_extensions() helpers, along
with a documented config.ini example file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Christoph K.
2026-03-14 09:41:07 +01:00
parent 65b411b23d
commit 344c22b6e3
3 changed files with 411 additions and 0 deletions

51
config.ini Normal file
View File

@@ -0,0 +1,51 @@
# photo-converter configuration
# Lines starting with # or ; are comments.
# Copy this file and adjust paths before running in batch mode:
# photo-converter --batch --config config.ini
[batch]
# Directory containing input images (RAW or standard formats)
input_dir = import
# Directory where converted images are written
output_dir = output
# Scan input_dir recursively into subdirectories (true/false)
recursive = false
# Comma-separated list of file extensions to process (case-insensitive)
file_extensions = arw,cr2,cr3,nef,dng,orf,rw2,raf,pef,jpg,jpeg,png,tif,tiff
[conversion]
# Film type detection strategy:
# auto NegativeDetector analyses the histogram and orange mask
# c41 force C-41 colour negative processing
# bw force B&W negative processing
film_type = auto
# Output format:
# png16 16-bit PNG (lossless, archival quality)
# png8 8-bit PNG (lossless, smaller files)
# tiff16 16-bit TIFF (lossless, for professional editing)
# jpg 8-bit JPEG (lossy, smallest files)
output_format = png16
# Output bit depth (8 or 16); ignored when format is jpeg
output_bit_depth = 16
# Automatically detect and crop the film frame (true/false)
auto_crop = true
# Apply unsharp-mask sharpening (true/false)
sharpen = true
# Invert negative to positive (true/false)
# Set to false if input is already a positive (slide/print)
invert = true
[quality]
# JPEG output quality [0-100]; only used when output_format = jpg
jpeg_quality = 95
# Unsharp-mask strength [0.0-1.0]
sharpen_strength = 0.5