Fix image crop during embed

master
Kishor Gandham 8 years ago committed by GitHub
parent 02e621739c
commit cf75e90e48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -446,7 +446,11 @@ func imageCalculations(o *Options, inWidth, inHeight int) float64 {
switch { switch {
// Fixed width and height // Fixed width and height
case o.Width > 0 && o.Height > 0: case o.Width > 0 && o.Height > 0:
if o.Crop {
factor = math.Min(xfactor, yfactor) factor = math.Min(xfactor, yfactor)
} else {
factor = math.Max(xfactor, yfactor)
}
// Fixed width, auto height // Fixed width, auto height
case o.Width > 0: case o.Width > 0:
if o.Crop { if o.Crop {

Loading…
Cancel
Save