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:
@@ -29,7 +29,9 @@ var (
|
|||||||
const MaxDimension = imageprocessor.MaxOutputDimension
|
const MaxDimension = imageprocessor.MaxOutputDimension
|
||||||
|
|
||||||
// ValidateDimension checks one requested width or height; name ("width" or
|
// 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 {
|
func ValidateDimension(name string, value int) error {
|
||||||
if value < 0 {
|
if value < 0 {
|
||||||
return fmt.Errorf("%w: %s is negative", ErrInvalidSize, name)
|
return fmt.Errorf("%w: %s is negative", ErrInvalidSize, name)
|
||||||
|
|||||||
Reference in New Issue
Block a user