-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metadata: Normalize GPS coordinates to be within a common range to avoid frontend errors #2109
Comments
You can disable location estimates in Settings > Library |
Disabling location estimation doesn't fix it. I understand that location estimation is based on other photos with a similar time stamp. However, I've never been even close to the North Pole or the other marked locations. The estimations should be close to other photos' locations, right? |
Disabling it won't instantly remove already estimated locations. Without seeing the specific files and metadata, it's a lot of (ineffective) guesswork. The algorithm may for example not work well in certain edge cases. We can only test with what we have. |
Alrighty, will wait for a bit for them to disappear. Yeah sorry, it's also frustrating for me to not find the referenced photos. I had thought you might have some pointers of how to find them. Will report back if anything changes or I have an idea. |
Hi, I recently encountered this issue with a photo I took. The photo was actually taken at approximately Another interesting point is the following message in the browser console when opening the "Places" map:
My guess is that this problem is caused by cameras/phones setting wrong exif location data, but there might be some way to adjust/ignore invalid data that photoprism could do. The image shown above is in this zip file buggy_panorama.zip (image sha256 is Disabling location estimates does not seem to change the behavior. |
Thanks for reporting @xarantolus . @DanBenHa assumed this issue is caused by invalid lat/lng values you might be able to find the affected files in the database by sorting the photos table by lat or lng to see if there are invalid values. Might be the same issue as #2728 |
The problem with latitude and longitude is that the earth is round. So technically they are unlimited if you just keep going. Some device and software developers implicitly or explicitly fail if the values are not within a certain range, while others just keep working. Then there are all kinds of users with different expectations. Some don't want us to validate or change their original metadata, others expect us to handle and fix even the craziest edge cases. It COULD well be worth normalizing position metadata and ideally providing a complete developer guide just for geodata. |
Here's a check I once added after Google developers insisted on supporting higher longitudes and latitudes. This could eventually lead to a denial of service attack, as the calculations might lead to very high CPU usage (so I prevented this by adding this check - but not because it was mathematically impossible): photoprism/pkg/pluscode/pluscode.go Lines 43 to 54 in 015826d
It's beyond the scope of what we can do to educate the world and normalize/fix this in every single library out there and on every cheap China/Google device. |
I'm experiencing a related issue to what has been mentioned here. After I uploaded my first batches of photos to a new PhotoPrism deployment, my thumbnails on the UI at For what it's worth, all my photos that I've uploaded so far were taken with an iPhone 14 Pro and I'm using Photosync to convert .HEIC to .JPG when syncing via WebDAV to PhotoPrism. As a specific example, in the screenshot below, the request sent when I click the rendered thumbnail is
|
Latitude and longitude do not appear to be out of range at first sight. Since it could still be a problem with the specific files you have, it would be helpful to get samples for testing. See https://photoprism.app/contact for details. |
Signed-off-by: Michael Mayer <michael@photoprism.app>
With these changes, the GPS latitude and longitude are forced to be within a valid range so that the map UI doesn't break. Of course, this is no guarantee that the coordinates will be correct in case your phone has a malfunction. An updated preview build will be available for testing soon. |
Note that the current GPS coordinate "normalization" is only a proof-of-concept. We leave it to contributors to improve this, e.g. by figuring out what best practices exist to correct out-of-range values. |
I just sent the file. Sorry for the delay! Hope it helps with testing. |
Thank you for sending the file. Do you still see issues with this file when using the preview? For me it is displayed on the map in PhotoPrism at the same location that I get displayed when I enter the coordinates in Google Maps. If I click on the thumbnail on the map it opens without error. |
I'm not sure what you mean by the preview, but if you're talking about the view of the /places url endpoint, then I do see the thumbnail displayed in the correct location (as in the screenshot that I posted in a previous comment). The issue that I'm experiencing for this file and all my other files is that clicking the rendered thumbnail results in the "No Pictures Found" notification. The API request that gets triggered when I click on the thumbnail is For me, the photo thumbnails have always been appearing in correct locations. The issue that I've observed is the inability to use the map to zoom in to a location, click a thumbnail photo, and view that photo. Clicking on any photo thumbnail tells me "No Pictures Found". I think the intended behavior would be for the full photo to be displayed in a full screen view, but I'm not sure since I get the same "No Pictures Found" behavior for all photos. This is true for dozens of photos that I've tested, with locations in the US and New Zealand. I hope that helps clarify. Looking at the source code for a few minutes, I think there's a high likelihood that the source of the empty array is line 57 of photos_search_geo.go, where |
I tested exactly this on our development preview and it worked with your file. So I assume the issue is fixed :) |
Note that you can also use our public demo at demo.photoprism.app to test the preview as it is based on it. |
I finally got around to testing the preview image and the issue that I reported is fixed! Thanks!! I did need to re-index my photos, but after the re-indexing was complete, I was able to click photo thumbnails on the /places page and see the full-size images. |
What does not work as described in the documentation?
There are a few thumbnail photos on the map at locations that I've never been to (see red labels in screenshot). If I click on one of the thumbnails I get the notification "no photos found", so I can't check if these photos really have erroneous coordinates.
How can we reproduce it?
Don't know yet, since I can't find the photos that cause it.
What behavior do you expect?
Thumbnails should only appear at locations that are present in photos' geo locations.
What could be the cause of your problem?
Maybe an extraction of the location data? However, it's odd that the link to the photo is broken.
Can you provide us with example files for testing, error logs, or screenshots?

Which software versions do you use?
On what kind of device is PhotoPrism installed?
The text was updated successfully, but these errors were encountered: