Skip to content

Batch: output filename templating ({stem}, suffixes) #75

Description

@swperb

Build on the batch mode from #15. Today --out-dir D writes D/<basename>.<ext>. Add an output template so batch runs can rename (thumbnails, suffixes).

Proposed

  • --out-template "PATTERN" with tokens: {stem} (basename, no ext), {ext} (chosen extension), {name} (full basename).
  • Example: imgcli -i "*.jpg" --out-dir thumbs --out-template "{stem}-400.png" -vf "scale=400:-1"
  • Default (no template) stays {stem}.{ext}.

Where

run_batch() in src/main.c builds outpath — add token substitution there. Reject / in the rendered name (stay within --out-dir). Update --help, README, AGENTS.md, and add a tests/run.sh case.
Difficulty: easy–medium.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions