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

Đang mở
#31 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
50/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
cli

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Python
Star
1
Fork
0
Merge trung bình
4 giờ 13 phút
Pull request đã merge (30 ngày)
2

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của cadentdev/ipro

Tất cả issue của cadentdev/ipro

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.