mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-01-03 10:43:58 +02:00
Apply dprScale after min width/height
This commit is contained in:
parent
c98752651a
commit
9b65b7257d
@ -113,9 +113,6 @@ func calcScale(width, height int, po *options.ProcessingOptions, imgtype imagety
|
||||
dprScale = math.Min(dprScale, math.Min(wshrink, hshrink))
|
||||
}
|
||||
|
||||
wshrink /= dprScale
|
||||
hshrink /= dprScale
|
||||
|
||||
if po.MinWidth > 0 {
|
||||
if minShrink := srcW / float64(po.MinWidth); minShrink < wshrink {
|
||||
hshrink /= wshrink / minShrink
|
||||
@ -130,6 +127,9 @@ func calcScale(width, height int, po *options.ProcessingOptions, imgtype imagety
|
||||
}
|
||||
}
|
||||
|
||||
wshrink /= dprScale
|
||||
hshrink /= dprScale
|
||||
|
||||
if wshrink > srcW {
|
||||
wshrink = srcW
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user