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

Abierto
#31 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
50/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
cli

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Python
Estrellas
1
Forks
0
Merge medio
4 h 13 min
PR fusionados (30 d)
2

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de cadentdev/ipro

Todos los issues de cadentdev/ipro

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.