-
Notifications
You must be signed in to change notification settings - Fork 1
/
gps.go
39 lines (27 loc) · 907 Bytes
/
gps.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package update
import (
"fmt"
)
func AppendGPSPropertiesWithLatitudeAndLongitude(exif_props map[string]interface{}, lat float64, lon float64) error {
gps_lat, err := PrepareDecimalGPSLatitudeTag(lat)
if err != nil {
return fmt.Errorf("Failed to prepare GPSLatitudeTag, %v", err)
}
gps_lat_ref, err := PrepareDecimalGPSLatitudeRefTag(lat)
if err != nil {
return fmt.Errorf("Failed to prepare GPSLatitudeRefTag, %v", err)
}
gps_lon, err := PrepareDecimalGPSLongitudeTag(lon)
if err != nil {
return fmt.Errorf("Failed to prepare GPSLatitudeTag, %v", err)
}
gps_lon_ref, err := PrepareDecimalGPSLongitudeRefTag(lon)
if err != nil {
return fmt.Errorf("Failed to prepare GPSLatitudeRefTag, %v", err)
}
exif_props["GPSLatitude"] = gps_lat
exif_props["GPSLatitudeRef"] = gps_lat_ref
exif_props["GPSLongitude"] = gps_lon
exif_props["GPSLongitudeRef"] = gps_lon_ref
return nil
}