package image type Tool struct { } // CustomScale 获取缩放比例 func CustomScale(width, dWidth uint) float64 { f := float64(width) / float64(dWidth) return float64(int(f*1000)) / 1000 }