Output naming: --prefix/--suffix and safe default names beside the source

Open
#31 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
50/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
cli

Research direction

Read the implementations of resize and convert, along with the output naming behavior described in related issues #21 and #25. Decide how --prefix/--suffix, size suffixes beside the source, and --force should interact; the issue also raises a template flag as an alternative. Done means the chosen naming behavior is consistent and existing files are protected from overwrite unless --force is supplied.

Written by the indexing model from the issue text.

Description

Problem

resize (single size) and convert keep the input's basename, so the output folder is the only thing keeping a derivative apart from its source. That is the root cause of #25: point --output at the source folder and the original is overwritten.

It also means batch scripts must rename each output afterward when they want web-ready names.

Options

  1. --prefix / --suffix: e.g. --suffix -web gives photo-web.jpg. Simple, predictable, and the user picks a name that makes sense in a URL.
  2. Default size suffix when writing beside the source. Multi-size resize already names files photo-300.jpg (#21). Using the same -{size} suffix whenever the output dir resolves to the input's dir would make #25 impossible by default.
  3. Datestamp (e.g. photo-20261117-1530.jpg): guarantees uniqueness, but the names are not deterministic, re-runs pile up copies, and the stamp ends up in public image URLs (Squarespace uses the filename as the URL).

Recommendation

Do 1 and 2. Treat a datestamp as an opt-in pattern, not the default. Pair it with a hard refusal to overwrite any existing file unless --force is given, which closes #25 even if naming is misconfigured.

A small --name template ({stem}, {w}, {h}, {date}) would cover all three options with one flag, if that is not over-engineering.

Context

Related: #25 (overwrite), #21 (output naming). Hit on 2026-11-17 with ipro 1.7.0 while renaming 24 exports by hand.

— Emily

Dominant language
Python
Stars
1
Forks
0
Avg merge
4h 13m
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cadentdev/ipro

All issues in cadentdev/ipro

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.