From 0dac2c212069aab9cfce61785d60177b7cf454ab Mon Sep 17 00:00:00 2001 From: sneak Date: Fri, 16 Oct 2026 01:59:24 +0000 Subject: [PATCH] Say what a 0 side does in the ValidateDimension doc comment It said 0 meant "original size"; the side is worked out from the source's proportions, as README.md now says. Model: opus-5-5 --- internal/imgcache/urlparser.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/imgcache/urlparser.go b/internal/imgcache/urlparser.go index 6c58c20..46bba16 100644 --- a/internal/imgcache/urlparser.go +++ b/internal/imgcache/urlparser.go @@ -29,7 +29,9 @@ var ( const MaxDimension = imageprocessor.MaxOutputDimension // ValidateDimension checks one requested width or height; name ("width" or -// "height") appears in the error. 0 means "original size" and is valid. +// "height") appears in the error. 0 is valid: that side is then worked out from +// the source's proportions and the other requested side, rounded down but at +// least 1, or is the source's own side when the other side is 0 too. func ValidateDimension(name string, value int) error { if value < 0 { return fmt.Errorf("%w: %s is negative", ErrInvalidSize, name)