mirror of
https://github.com/likelovewant/ollama-for-amd.git
synced 2025-12-21 14:26:30 +00:00
refactor: use builtin max and min
This commit is contained in:
committed by
Michael Yang
parent
4a48937ef1
commit
47298fce39
@@ -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{
|
||||||
|
|||||||
Reference in New Issue
Block a user