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
if scaleW < scaleH {
newRes = image.Point{
targetRes.X,
int(math.Floor(float64(imageRes.Y)*scaleW), float64(targetRes.Y))),
int(min(math.Floor(float64(imageRes.Y)*scaleW), float64(targetRes.Y))),
}
} else {
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