fix: rename min function to avoid conflict with builtin
Build and Deploy / build (push) Successful in 2m39s
Build and Deploy / deploy (push) Successful in 9s

This commit is contained in:
2026-07-17 10:57:45 +00:00
parent 8c8787135d
commit 89b688424a
+2 -2
View File
@@ -330,7 +330,7 @@ func preprocessMath(img image.Image) ([]float32, error) {
// 计算缩放比例 // 计算缩放比例
bounds := img.Bounds() bounds := img.Bounds()
srcW, srcH := bounds.Dx(), bounds.Dy() srcW, srcH := bounds.Dx(), bounds.Dy()
ratio := min(float64(targetW)/float64(srcW), float64(targetH)/float64(srcH)) ratio := minFloat(float64(targetW)/float64(srcW), float64(targetH)/float64(srcH))
newW := int(float64(srcW) * ratio) newW := int(float64(srcW) * ratio)
newH := int(float64(srcH) * ratio) newH := int(float64(srcH) * ratio)
@@ -464,7 +464,7 @@ func decodeMath(output []float32, outputShape []int64) string {
return result return result
} }
func min(a, b float64) float64 { func minFloat(a, b float64) float64 {
if a < b { if a < b {
return a return a
} }