Refuse a size whose computed side exceeds the maximum (closes #241) #258

Merged
clawbot merged 2 commits from issue-241-bound-computed-side into next 2026-10-13 09:44:45 +02:00
2 Commits
Author SHA1 Message Date
clawbot 3c40863c2e Refuse a size whose computed side exceeds the maximum (closes #241)
check / check (push) Waiting to run
A side given as 0 is computed from the source's proportions, and
nothing held it to 8192: 0x8192 of a 3000x600 source was resized to
40960x8192 and encoded. Process now refuses such a size with
ErrOutputTooLarge once it knows the source's dimensions, before the
resize and the encode, and both image routes answer it 400 with the
JSON error body. It is a processing error, not a failed fetch, so it
is never negative-cached. imgcache.MaxDimension is now
imageprocessor.MaxOutputDimension, so the request limit and the output
limit are one value. README.md says it under Routes and Encrypted URLs.

Model: opus-5-5
2026-10-13 07:08:17 +00:00
clawbot ba1930c5cc Test that a size whose computed side exceeds the maximum is refused (part of #241)
Failing tests first. Through both image routes, 0x8192 of a 3000x600
source and 8192x0 of a 600x3000 source must answer 400 with the JSON
error body; orig, a size with both sides given and a 0 side whose
computed side stays within 8192 must be served as before, after the
refusals. In the image processor, a 0 side computed to exactly 8192 is
kept and one above is refused with ErrOutputTooLarge, which does not
exist yet.

Model: opus-5-5
2026-10-13 07:07:49 +00:00