mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-09 07:28:44 -07:00
Fix image crop during embed
This commit is contained in:
parent
02e621739c
commit
cf75e90e48
1 changed files with 5 additions and 1 deletions
|
|
@ -446,7 +446,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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue