fix: threshold calculation and resize update

This commit is contained in:
Gustavo "Guz" L. de Mello
2024-06-12 16:30:14 -03:00
parent a2426b8f87
commit eee1503855

View File

@@ -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 {