"git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "448c72a230ceb31ae60e70e3b62e327314928a5e"
Commit 47298fce authored by shengxinjing's avatar shengxinjing Committed by Michael Yang
Browse files

refactor: use builtin max and min

parent 4a48937e
...@@ -124,7 +124,7 @@ func (p ImageProcessor) maxResolution(imageRes, targetRes image.Point) image.Poi ...@@ -124,7 +124,7 @@ func (p ImageProcessor) maxResolution(imageRes, targetRes image.Point) image.Poi
if scaleW < scaleH { if scaleW < scaleH {
newRes = image.Point{ newRes = image.Point{
targetRes.X, targetRes.X,
int(math.Floor(float64(imageRes.Y)*scaleW), float64(targetRes.Y))), int(min(math.Floor(float64(imageRes.Y)*scaleW), float64(targetRes.Y))),
} }
} else { } else {
newRes = image.Point{ newRes = image.Point{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment