Skip to content

Commit

Permalink
Merge pull request #224 from kishorgandham/patch-1
Browse files Browse the repository at this point in the history
Fix image crop during embed
  • Loading branch information
h2non authored Dec 5, 2018
2 parents 7f4a97c + cf75e90 commit d67c48e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion resizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d67c48e

Please sign in to comment.