Repository navigation
[PR] fix: restore byte-triggered image re-encoding - #7147
ranxianglei merged 1 commit into
Conversation
Restore ordinary same-dimension encodes above the existing byte threshold. Keep the forced path and keep-smaller policy unchanged, and verify real codec output, original-byte preservation and proxy/plugin HTTP requests. Fixes ranxianglei#7146
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Review: mergeable. I independently re-derived the gate's truth table, read all 17 tests, and checked CI live on head What I verified (independent of the PR's claims):
Non-blocking observation (pre-existing, not introduced here): the 结构化八问
判定: 可合。 修复正确、强制路径可证不变、测试有牙、CI 绿、无回归、无新配置。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Follow-up on the non-blocking observation above: the forced-path doc tangle ( This PR (#7147) itself is unaffected and remains mergeable — it provably does not touch the forced path. |
Fixes #7146.
Problem
The ordinary image pass admits a candidate when its dimensions or decoded byte size exceed the existing thresholds. The encoder then rejects every within-limit image when
force=false, so the byte-size trigger never reaches a normal re-encode.On current master, a real 256 × 256 PNG written with PNG compression level 0 remains 262,503 bytes on the wire. The same installed Jimp codec can re-encode it to 757 bytes at unchanged dimensions with identical RGBA pixels.
Change
Restore the pre-#3701 byte-size gate in
doRescale. The production change is one condition: ordinary within-limit images above 100 KiB reach the existing encoder and 20% keep-smaller check.The forced encoder's truth table is unchanged. The existing format, quality, dimension limit, cache, original-image exemption and outbound-copy behavior are retained.
This reduces request bytes for images with encoding headroom. It does not reduce pixel-based vision token counts for same-dimension images. PNG remains lossless in the regression; JPEG uses the existing quality-80 policy. Newly admitted candidates pay the existing encode cost once per cache lifetime; low-benefit results still pass through unchanged.
Validation
git diff --checkpassed.Prior work
Audited all 258 prior fork heads, five distinct image-rescale source versions, and full file history. The gate was last changed by
6e39a65d; its #3706 review corrected forced-mode comments, not the ordinary branch. Existing cache-key, cache-budget and original-ref work addresses different mechanisms. No configuration, kernel, persistence, or prompt strings change.