Bug 497410

Summary: "Failed to parse clipboard data - KGeoTag" : "Could not parse the clipboard's text to valid coordinates"
Product: [Applications] kgeotag Reporter: david_crossley
Component: GeneralAssignee: Tobias Leupold <tl>
Status: RESOLVED FIXED    
Severity: normal CC: tl
Priority: NOR    
Version First Reported In: 1.7.0   
Target Milestone: ---   
Platform: Flatpak   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description david_crossley 2024-12-13 12:28:01 UTC
SUMMARY
I get an error message "Failed to parse clipboard data - KGeoTag" when I try to paste the clipboard coordinates.

STEPS TO REPRODUCE
1. Right click the map -> Current Map Centre -> Copy Coordinates to Clipboard,  I get the coordinates in the my clipboard.  This is a paste of the clipboard inside the brackets (19.814660° E, 82.695109° N).  -  This bit works OK.
2. Right click on an image file and select -> Set coordinates from clipboard.  I get an error message box titled "Failed to parse clipboard data - KGeoTag" and the message "Could not parse the clipboard's text to valid coordinates".
3. Also tried using Google Maps (notice bugid 458537) - paste of clipboard in brackets (49.17126432760858, -12.472038542224464) and I get the same error message.

OBSERVED RESULT
"Failed to parse clipboard data - KGeoTag" : "Could not parse the clipboard's text to valid coordinates"

EXPECTED RESULT
That it sets the clipboards coordinates into the file.

SOFTWARE/OS VERSIONS
Linux Mint 22 Cinnamon 
Flatpak version of KGeoTag 1.7.0 installed using the "Software Manager" within Linux Mint.

ADDITIONAL INFORMATION
Comment 1 Tobias Leupold 2024-12-13 12:49:29 UTC
Thanks for your report!

The "Set coordinates from clipboard" feature was intended to be used with coordinates copied from Google Maps and OpenStreetMap, actually not with those you can copy from KGeoTag itself. Anyway, Google Maps and OpenStreetMap should work – and maybe also what we export ourselves.

I'll investigate this.
Comment 2 Tobias Leupold 2024-12-13 13:10:06 UTC
Okay, I can at least partly confirm this. And I think I also know where the problem could be …

For example, take a place in Hof's old town. From Google, you can copy "50.31774500000000, 11.915441000000000", from OSM, you can copy "geo:50.317745,11.915441?z=19" (of course without the quotes). Both can be assigned to a photo using "Set coordinates from clipboard" without a problem.

However, I also can't use your example coordinates, "49.17126432760858, -12.472038542224464", this actually fails. But "49.17126432760858, 12.472038542224464" works. Looks like the parsing is not smart enough to handle the negative coordinates part.

Additionally, you're right this function should be able to handle KGeoTag's own coordinates export.

I'll fix this ASAP.
Comment 3 Tobias Leupold 2024-12-13 13:27:31 UTC
Git commit 506566cc8c5453e16874f6e4cb00e0739ab90557 by Tobias Leupold.
Committed on 13/12/2024 at 13:26.
Pushed by tleupold into branch 'master'.

Fixed parsing (partly) negative Google Maps and OSM coordinates

M  +11   -4    src/ImagesListView.cpp

https://invent.kde.org/graphics/kgeotag/-/commit/506566cc8c5453e16874f6e4cb00e0739ab90557
Comment 4 Tobias Leupold 2024-12-14 13:32:03 UTC
Parsing KGeoTag's own human-readable format was a bit harder, however, it should work now (cf. commit fa01ce4dba68f27302456cdbe8ec220f7e388760). Feel free to re-open if there's still something wrong with assigning coordinates from the clipboard!