mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-07-12 23:00:55 +02:00
Apply dprScale after min width/height
This commit is contained in:
@ -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
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user