From eee1503855e102e88aef9280a23717075e61c710 Mon Sep 17 00:00:00 2001 From: "Gustavo \"Guz\" L. de Mello" Date: Wed, 12 Jun 2024 16:30:14 -0300 Subject: [PATCH] fix: threshold calculation and resize update --- internals/image.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internals/image.go b/internals/image.go index 8d372f7..bc54cb7 100644 --- a/internals/image.go +++ b/internals/image.go @@ -105,7 +105,7 @@ func (i *Image) Optimize(threshold int) { return } - d := threshold / w + d := w / threshold i.Scale(d * -1) } @@ -124,7 +124,7 @@ func (i *Image) Scale(s int) { nw, nh = w, h } - imaging.Resize(i.img, nw, nh, imaging.CatmullRom) + i.img = imaging.Resize(i.img, nw, nh, imaging.CatmullRom) } func (i *Image) GetMime() string {