photoprism/pkg/clean/altitude.go
Michael Mayer ef6e3d3f9d Metadata: Ensure the altitude is not out of range and fix logs #3182
Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-02-09 11:51:26 +01:00

11 lines
208 B
Go

package clean
// Altitude returns the altitude within a maximum range as an integer, or 0 if it is invalid.
func Altitude(a float64) int {
if a < -15000000 || a > 15000000 {
return 0
}
return int(a)
}