diff --git a/resizer.go b/resizer.go index 9e13ac3..5ba32e1 100644 --- a/resizer.go +++ b/resizer.go @@ -443,7 +443,11 @@ func imageCalculations(o *Options, inWidth, inHeight int) float64 { switch { // Fixed width and height case o.Width > 0 && o.Height > 0: - factor = math.Min(xfactor, yfactor) + if o.Crop { + factor = math.Min(xfactor, yfactor) + } else { + factor = math.Max(xfactor, yfactor) + } // Fixed width, auto height case o.Width > 0: if o.Crop {