resize: add --max-size to pick JPEG quality for a file-size budget
还没有人认领这个 Issue。
评估
调研方向
Start by reading the ipro resize command implementation and its existing quality option, then trace how it encodes and writes resized images. Decide how the size search and quality floor should work, including behavior when the floor still exceeds the budget. Done means --max-size selects the highest quality that fits, warns when the floor cannot meet the budget, and reports the chosen quality and final size.
由索引模型根据 Issue 内容生成。
描述
Problem
Web platforms give a file-size budget, not a quality number. Squarespace's guidance is under 500 KB. The right JPEG quality to hit that budget varies a lot from photo to photo: in one 24-photo batch at 2500px, quality ranged from 70 to 82 to land near 500 KB. Busy, detailed frames needed much lower quality than flat ones.
Today the only way is an outside loop that re-runs ipro resize at falling --quality values until the file fits. That meant up to 8 full resize passes per photo.
Proposal
Add --max-size 500KB (or --target-size). ipro searches for the highest quality that fits, e.g. a binary search between a floor and a ceiling, encoding in memory and writing once.
Things to decide:
- Quality floor. Add
--min-quality(default maybe 70). If the image cannot fit at the floor, write it at the floor and warn, rather than dropping into heavy artifacts silently. In practice 11 of 24 photos could not reach 500 KB at q70. Keeping the larger file was the right call for those. - Report the chosen quality and final size in the success line, e.g.
✓ Created: photo.jpg (2500x1875, q74, 488 KB).
Context
Hit on 2026-11-17 with ipro 1.7.0, Squarespace web exports.
— Emily
- 主要语言
- Python
- 星标
- 1
- 派生
- 0
- 平均合并
- 4 小时 13 分钟
- 30 天内合并 PR
- 2
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cadentdev/ipro 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 64/100
-
难度 4/5 3-5 天 新手友好度 42/100
-
难度 4/5 3-5 天 新手友好度 50/100
-
难度 4/5 3-5 天 新手友好度 52/100
-
难度 3/5 1-2 天 新手友好度 68/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
LearningCircuit/local-deep-research#10161 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
chore: contact address [email protected]可能已有人在做 @larsrollik 今天认领。 未关闭
难度 1/5 1-3 小时 新手友好度 82/100
-
bug
难度 2/5 1-3 小时 新手友好度 80/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
Gustavo-Galvao-e-Silva/panchi#228 ·
维护者通常 1 天内回复