resize: add --max-size to pick JPEG quality for a file-size budget
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 45/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 1
- Fork
- 0
- Merge medio
- 4h 13m
- PR unite (30g)
- 2
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cadentdev/ipro
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 50/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
Tutte le issue di cadentdev/ipro
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
LearningCircuit/local-deep-research#10161 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
chore: contact address [email protected]Forse già presa @larsrollik l’ha presa oggi. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Gustavo-Galvao-e-Silva/panchi#228 ·
I maintainer di solito rispondono entro 1 giorno