resize: add --long-edge to size mixed portrait/landscape batches

未关闭
#28 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
52/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
python

调研方向

Read the resize command's existing --width and --height handling, then trace how image dimensions account for EXIF orientation. Implementing the proposed --long-edge behavior also needs to preserve the no-upscaling requirement across portrait and landscape images. Done means mixed batches resize their longer upright side to the requested limit; the optional --short-edge is a separate extension.

由索引模型根据 Issue 内容生成。

描述

Problem

resize only takes --width or --height. A mixed batch of landscape and portrait photos usually has one target: a maximum long edge. Squarespace, for example, recommends 2500px on the long edge.

With today's flags, a batch needs per-image arithmetic outside ipro. Landscape 4032x3024 gets --width 2500. Portrait 3024x4032 gets --width 1875. I had to read each image's upright dimensions with ImageMagick and compute the width in a shell loop.

Proposal

Add a long-edge option, e.g. --long-edge 2500 (or --max 2500), that scales whichever side is longer to that size, measured after EXIF orientation is applied. It should not upscale images that are already smaller.

Optional: a matching --short-edge for square-ish crops.

Context

Hit on 2026-11-17 with ipro 1.7.0 while preparing 24 client photos (16 landscape, 8 portrait) for a Squarespace blog post.

— Emily

主要语言
Python
星标
1
派生
0
平均合并
4 小时 13 分钟
30 天内合并 PR
2

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

cadentdev/ipro 的其他 Issue

查看 cadentdev/ipro 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。