Say what a 0 side does in the ValidateDimension doc comment
check / check (push) Canceled after 0s

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
This commit is contained in:
2026-10-16 01:59:24 +00:00
parent dc1c069ad6
commit 0dac2c2120
+3 -1
View File
@@ -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)