Handle EXIF location data set to "NaN"
Probably Android's new privacy thing. Jerks.
This commit is contained in:
parent
1cfe51f894
commit
00d26a684a
1 changed files with 2 additions and 1 deletions
|
|
@ -10,6 +10,7 @@ import (
|
|||
_ "image/jpeg" // register JPEG format
|
||||
_ "image/png" // register PNG format
|
||||
"io"
|
||||
"math"
|
||||
"time"
|
||||
|
||||
"github.com/Gleipnir-Technology/bob"
|
||||
|
|
@ -107,7 +108,7 @@ func saveImageUploads(ctx context.Context, tx bob.Tx, uploads []ImageUpload) (mo
|
|||
|
||||
// TODO: figure out how to do this via the setter...?
|
||||
if u.Exif != nil {
|
||||
if u.Exif.GPS != nil {
|
||||
if u.Exif.GPS != nil && !(math.IsNaN(u.Exif.GPS.Longitude) || math.IsNaN(u.Exif.GPS.Latitude)) {
|
||||
_, err = psql.Update(
|
||||
um.Table("publicreport.image"),
|
||||
um.SetCol("location").To(fmt.Sprintf("ST_Point(%f, %f, 4326)", u.Exif.GPS.Longitude, u.Exif.GPS.Latitude)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue