mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-01-18 11:12:10 +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))
|
dprScale = math.Min(dprScale, math.Min(wshrink, hshrink))
|
||||||
}
|
}
|
||||||
|
|
||||||
wshrink /= dprScale
|
|
||||||
hshrink /= dprScale
|
|
||||||
|
|
||||||
if po.MinWidth > 0 {
|
if po.MinWidth > 0 {
|
||||||
if minShrink := srcW / float64(po.MinWidth); minShrink < wshrink {
|
if minShrink := srcW / float64(po.MinWidth); minShrink < wshrink {
|
||||||
hshrink /= wshrink / minShrink
|
hshrink /= wshrink / minShrink
|
||||||
@ -130,6 +127,9 @@ func calcScale(width, height int, po *options.ProcessingOptions, imgtype imagety
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wshrink /= dprScale
|
||||||
|
hshrink /= dprScale
|
||||||
|
|
||||||
if wshrink > srcW {
|
if wshrink > srcW {
|
||||||
wshrink = srcW
|
wshrink = srcW
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user