Summary: | The date is passed to iNaturalist in the wrong format | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Steve Franks <stevef48> |
Component: | Plugin-WebService-iNaturalist | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | caulier.gilles, joergmlpts, metzpinguin, stevef48 |
Priority: | NOR | ||
Version: | 7.7.0 | ||
Target Milestone: | --- | ||
Platform: | Microsoft Windows | ||
OS: | Microsoft Windows | ||
Latest Commit: | https://invent.kde.org/graphics/digikam/commit/a254cd10b48a3bdef2424fa2d7d4cee17bad0432 | Version Fixed In: | 7.7.0 |
Attachments: |
attachment-20768-0.html
Metadata and GPX |
Description
Steve Franks
2022-04-16 14:18:06 UTC
INaturalist receives:- 2022-04-14T08:56:52 GMT Summer Time Expects:- 2022-04-14 Thank you for your report. I have followed your steps to reproduce the issue. I have uploaded 3 images that I took yesterday and created an iNaturalist observation. This is the result: https://www.inaturalist.org/observations/111590956 "Missing date" is not reported and under "Observed:" the date, time, and my timezone are correctly shown. The date and time shown on the iNat website exactly matches the date and time of the first photo in DigiKam. My guess is that your timezone "GMT Summer Time" is not accepted by iNaturalist. The export plugin obtains it with QDateTime.timeZoneAbbreviation() from the first observation photo. That looks like an awfully long name for a timezone abbreviation and it is imaginable that the iNat API doesn't parse and process it correctly. Would you mind trying other names for your timezone? Gilles certainly knows class QDateTime better than me. Maybe he has a suggestion for an improvement. We definitely do not want to send only the date. Hi, I don't know if QDateTime as extra capabilities with time zone (perhaps in Qt6). Any way, in digiKam core, we have used QLocale method to make special time transformations. https://doc.qt.io/qt-5/qlocale.html#dateFormat Else, of course, take a look to QTimeZone : https://doc.qt.io/qt-5/qtimezone.html Gilles Created attachment 148191 [details] attachment-20768-0.html How do I change the timezone in digikam? Steve On Sat, 16 Apr 2022 at 17:59, <bugzilla_noreply@kde.org> wrote: > https://bugs.kde.org/show_bug.cgi?id=452677 > > caulier.gilles@gmail.com changed: > > What |Removed |Added > > ---------------------------------------------------------------------------- > Resolution|DOWNSTREAM |--- > Status|NEEDSINFO |REOPENED > Ever confirmed|0 |1 > > --- Comment #3 from caulier.gilles@gmail.com --- > Hi, > > I don't know if QDateTime as extra capabilities with time zone (perhaps in > Qt6). > > Any way, in digiKam core, we have used QLocale method to make special time > transformations. > > https://doc.qt.io/qt-5/qlocale.html#dateFormat > > Else, of course, take a look to QTimeZone : > > https://doc.qt.io/qt-5/qtimezone.html > > Gilles > > -- > You are receiving this mail because: > You reported the bug. Steve asks a good question. We are dealing with the timezone of a picture, not the system timezone. Gilles, is there an editor in DigiKam where one can edit the date and time and timezone of a picture? Where does the timezone of a picture come from? Will a picture that I took in February have a different timezone than a picture that I took yesterday? If would think so. So the timezone of a picture is constructed when DigiKam loads metadata of a picture? If so, DigiKam gives the picture timezone "GMT SUmmer Time". The date of an image, if available, comes from the image metadata, usually OriginalTime. DigiKam ignores the time zone. On the one hand, the cause is that cameras have not previously saved the time zone in the image metadata. Newer cameras use a fairly new metadata tag to store the time zone. But if I see it correctly in the code, only the date is transmitted if there are no other places in the code. https://invent.kde.org/graphics/digikam/-/blob/master/core/dplugins/generic/webservices/inaturalist/inattalker.cpp#L1286 Maik Thanks, Maik! The actual code is https://invent.kde.org/graphics/digikam/-/blob/master/core/dplugins/generic/webservices/inaturalist/inatwindow.cpp#L803 where the observation date and time is sent as "observed_on_string" to iNaturalist. This string is constructed in lines 799 to 801 where for Steve "GMT Summer Time" gets appended to the ISO date and time representation. Hi Steve, it seems the daylight savings time variant of GMT is called BST. Can you change your timezone to BST? That will be system-wide change of your computer's timezone not just a setting in DigiKam, if I understand correctly. You may need to reboot after that change. In DigiKam maybe under "Album" better click "Reread Metadata from Files" before you upload photos to iNaturalist again. I came across BST here: https://stackoverflow.com/questions/16086962/how-to-get-a-time-zone-from-a-location-using-latitude-and-longitude-coordinates That's info on querying the timezone based on date/time as well as latitude and longitude. That functionality would allow all photos with latitude/longitude in their metadata get correct timezones assigned. Maybe that's something to consider for Gilles and Maik. Joerg The QDateTime::toString(Qt::ISODate) function already appends a time zone extension if it exists. In the code, however, a time zone is appended again, that should be the problem. Maik Thanks for expaining, Maik! I will send a fix later today. Steve, if you are running on Linux, the following command runs DigiKam with timezone name BST instead: TZ=GMT0BST,M3.2.0/2:00:00,M11.1.0/2:00:00 digikam Joerg Merge request #173 has been created for the fix. Joerg Do not close this file until MR is not pushed in master : https://invent.kde.org/graphics/digikam/-/merge_requests/173 Gilles Also, patch must be applied to qt5-maintenance branch for 7.7.0 release Gilles Created attachment 148219 [details] Metadata and GPX I'm using Windows at present. The time zone is shown as (UTC+00) Dublin, Edinburgh, Lisbon, London. Daylight Saving Time is on. i.e. BST is GMT+1. I can't see any reference to Time Zone in either image metadata, or GPX files (from my Garmin GPS Etrex E22x). The metadata appears to only show date and time, the GPS converts times to Zulu (GMT) before exporting the GPX files. INaturalist seems to only be interested in the date, does that make Timezone irrelevant? The data for my observations https://www.inaturalist.org/observations/111507740 and https://www.inaturalist.org/observations/111909844 don't show times. iNaturalist does show the time that the observation was made as Apr 18, 2022 · 12:29 BST. Hope that this helps Steve (In reply to joergmlpts from comment #5) > Steve asks a good question. We are dealing with the timezone of a picture, > not the system timezone. > > Gilles, is there an editor in DigiKam where one can edit the date and time > and timezone of a picture? > > Where does the timezone of a picture come from? Will a picture that I took > in February have a different timezone than a picture that I took yesterday? > If would think so. So the timezone of a picture is constructed when DigiKam > loads metadata of a picture? If so, DigiKam gives the picture timezone "GMT > SUmmer Time". When I look at my pictures the only difference between GMT and BST is that the latter shows UTC +1:00 if I remember to correctly set daylight saving time on my cameras. (In reply to Steve Franks from comment #14) > Created attachment 148219 [details] > Metadata and GPX > > I'm using Windows at present. The time zone is shown as (UTC+00) Dublin, > Edinburgh, Lisbon, London. Daylight Saving Time is on. i.e. BST is GMT+1. > I can't see any reference to Time Zone in either image metadata, or GPX > files (from my Garmin GPS Etrex E22x). The metadata appears to only show > date and time, the GPS converts times to Zulu (GMT) before exporting the GPX > files. > INaturalist seems to only be interested in the date, does that make Timezone > irrelevant? The data for my observations > https://www.inaturalist.org/observations/111507740 and > https://www.inaturalist.org/observations/111909844 don't show times. > iNaturalist does show the time that the observation was made as Apr 18, 2022 > · 12:29 BST. > Hope that this helps > Steve Apologies. I have just noticed that some older observations do have times see:- https://www.inaturalist.org/observations?place_id=any&user_id=serendipterist&verifiable=any None of the times are shown as BST, some are GMT some UTC Steve Git commit a254cd10b48a3bdef2424fa2d7d4cee17bad0432 by Maik Qualmann. Committed on 23/04/2022 at 11:03. Pushed by mqualmann into branch 'qt5-maintenance'. Pass observation time in correct format from Joerg Lohse FIXED-IN: 7.7.0 M +1 -3 core/dplugins/generic/webservices/inaturalist/inatwindow.cpp https://invent.kde.org/graphics/digikam/commit/a254cd10b48a3bdef2424fa2d7d4cee17bad0432 |