Bug 431333 - Doesn't handle timezones well
Summary: Doesn't handle timezones well
Status: RESOLVED FIXED
Alias: None
Product: kgeotag
Classification: Applications
Component: General (show other bugs)
Version: 1.0.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Tobias Leupold
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-08 21:10 UTC by Isaac Wismer
Modified: 2021-01-10 15:19 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Isaac Wismer 2021-01-08 21:10:27 UTC
SUMMARY

I took some photos on my camera while on a hike in Switzerland, and now when I try to tag them with a location from my GPS watch, I need to set the time offset by 6 hours to get the times to match up (I'm in a time zone 6 hours away now). I know I had my camera set to the correct time, as in dolphin it shows the time as being UTC+1, but in KGeoTag it shows the time as UTC-5.

STEPS TO REPRODUCE
1. Take photos + record GPX with timezone other than your current
2. Try to tag the photos

OBSERVED RESULT
you need to set an offset of the time difference between the timezones

EXPECTED RESULT
The timezone difference should be handled automatically

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.77.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
It seems that KGeoTag just assumes that the photo timestamps are in your local timezone, but does the conversion for the GPX track. I could be wrong though as I haven't looked into the code.

Overall though, this is a really cool project and I'm now going through my photo library adding locations!
Comment 1 Tobias Leupold 2021-01-08 21:23:00 UTC
Hi, thanks for your bug report!

Am I right that you geotagged the photos in another timezone compared to the timezone they have been taken in? This might cause this ...

Actually, we had an extensive discussion about timezone-aware data handling in KPhotoAlbum recently. IIRC, the photo metadata doesn't normally provide a timezone (only the time itself, thus we can't know it), whereas the times of an GPX track are always stored in UTC. If so, there's no other chance than setting the offset manually.

I may be wrong though. Would you be so kind to send me an example photo and an example GPX file so that I can try to reproduce this? And the correct corresponding GPX timestamp? (via email if you want) I didn't see this with my test dataset.

If it's possible, the expected behavior for KGeoTag would be to calculate the right offset and preset it.
Comment 2 Isaac Wismer 2021-01-08 21:31:36 UTC
Ah, I didn't realize that the EXIF data doesn't contain the timezone. I guess that would explain why I had a hard time finding that data when making this bug report.
I will send you an email with test data.
If we can't automatically detect what timezone the photos are in, would it be possible to add a dropdown for selecting the timezone the photo was taken in (or at least an offset), so that I don't need to convert 6 hours into seconds manually?
Comment 3 Tobias Leupold 2021-01-08 21:32:56 UTC
I'll have a look at it. Such an option would be no problem I think.
Comment 4 Tobias Leupold 2021-01-10 15:19:25 UTC
Both manual timezone setting and automatic detection of timezones based on GPX data have been implemented now, so I think we can close this one :-)