openbenches / openbenches.org

OpenBenches.org - an open data repository for memorial benches
https://openbenches.org/
MIT License
170 stars 26 forks source link

Handle bad EXIF location data better #361

Closed RedAuburn closed 7 months ago

RedAuburn commented 7 months ago

uploading a bad exif results in an uncaught error, and a grey map:

image

with this image: 2024-04-10-10-35-34-076

in console:

Uncaught Error: Invalid LatLng object: (NaN, NaN)
    v LatLng.js:32
    w LatLng.js:123
    setView Map.js:181
    exifdata logged_in:420
    i load-image-meta.js:166
    onload load-image.js:64
    d load-image.js:63
    i load-image-meta.js:100
    c load-image-meta.js:183
    <anonymous> logged_in:336
    EventHandlerNonNull* logged_in:315

of course, bad exif shouldn't be created in the first place, but it'd be good to handle it. maybe a toast warning that the exif data isn't parseable etc. (issue for bad exif creation is here: https://gitlab.com/LineageOS/issues/android/-/issues/6987)

edent commented 7 months ago

Oooh, interesting. Yes, the code should alert on NaN. I'll see if I can fix it.

Thanks for all the great benches!

RedAuburn commented 7 months ago

Woah that was quick, thank you! 😊