Bug 317920

Summary: Time zone data of IPTC metadata Date Created is unavailable and deleted in MetadataEdit [patch]
Product: [Applications] digikam Reporter: bfield <bitfield77>
Component: Plugin-Generic-MetadataEditAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, metzpinguin
Priority: NOR Keywords: testcase
Version: unspecified   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed In: 4.11.0
Sentry Crash Report:
Attachments: timezone.patch
timezone2.patch
screenshot.png
timezone3.patch

Description bfield 2013-04-06 11:58:24 UTC
Time zone information of IPTC Date Created field seems to be unused in kipiplugins MetadataEdit (and Digikam). Time zone data is correctly displayed in Digikam's Metadata side panel (e.g. 14:51:32+05:30) but unavailable in the Edit Metadata window. Even worse, time zone information previously present in time fields is reset by MetadataEdit  (e.g. 14:51:32+00:00) . 

This behaviour does not comply to IPTC Core and Extension Guidelines:
IPTC Core Image Section - Date Created: "If you are entering a time, you should include the time zone as well." See <http://www.iptc.org/std/photometadata/documentation/GenericGuidelines/Documents/iptccoreimagesection.htm>
Comment 1 bfield 2013-04-10 21:52:08 UTC
How to reproduce:
- Get jpeg image with time zone data other than "+00:00" or create as following:
exiftool -TimeCreated=14:51:32+05:30 image.jpeg 
- Open jpeg file in Digikam
- Check side panel Metadata - IPTC: Time Created 14:51:32+05:30
- Edit metada in Digikam: Image - Metadata - Edit All Metadata...
It is impossible to edit time zone data of time stamps here.
Change any IPTC data (e.g. City) and Apply.
- Check side panel Metadata - IPTC: Time Created 14:51:32+00:00
- alternatively verify IPTC data with exiftool
Comment 2 caulier.gilles 2015-05-20 09:15:03 UTC
This file still valid using last kipi-plugins 4.10.0 ?

Gilles Caulier
Comment 3 bfield 2015-05-25 08:56:54 UTC
Hi Gilles,

Thank you for following up on this long standing bug.
I will verify kipi-plugins 4.10.0 as soon as they are available on
Debian sid. Current kipi-plugins version on Debian sid is 4.4.0 which
still shows this error.

Best Regards,
bitfield


On 05/20/2015 11:15 AM, Gilles Caulier wrote:
> https://bugs.kde.org/show_bug.cgi?id=317920
> 
> Gilles Caulier <caulier.gilles@gmail.com> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |caulier.gilles@gmail.com
> 
> --- Comment #2 from Gilles Caulier <caulier.gilles@gmail.com> ---
> This file still valid using last kipi-plugins 4.10.0 ?
> 
> Gilles Caulier
>
Comment 4 Maik Qualmann 2015-05-27 19:45:47 UTC
Created attachment 92872 [details]
timezone.patch

Gilles,

This patch stores the time zone in a QLabel. If the date / time set to the current, the time zone will be set to +00:00. Or is a QComboBox with time zones to choose a better way? The IPTC tags expiration time and release time would have also been affected.

Maik
Comment 5 caulier.gilles 2015-05-27 19:51:12 UTC
MAik,

I recommend to attach here a screenshot to show exactly what's the patch do, especially if you want a feedback from user registered in this file.

Gilles
Comment 6 caulier.gilles 2015-05-27 19:53:17 UTC
Maik, 

Else, as MetadataEdit tool is to "Edit" value, i suppose that original reported want to change this value in dialog, not simply show it...

But i'm not sure, this is why i ask...

Gilles
Comment 7 Maik Qualmann 2015-05-27 20:24:01 UTC
Gilles,

the time zone is reset to +00:00 when saved metadata. But it is true, in an editor must the time zone also to be changed.

Maik
Comment 8 Maik Qualmann 2015-05-28 17:56:23 UTC
Created attachment 92892 [details]
timezone2.patch

New patch with combo box to select the time zone. This also fixes the digitalized time, created time, released time, expired time and makes the seconds editable.

Maik
Comment 9 Maik Qualmann 2015-05-28 17:57:04 UTC
Created attachment 92893 [details]
screenshot.png
Comment 10 caulier.gilles 2015-05-28 18:19:41 UTC
Maik,

Did you take a look to see if Time zone support also exist in Exif or XMP. I have a doubt about Exif, but about XMP, as a lots of IPTC core schema have been used to make XMP standard, there is a chance to found TimeZone support in base namespaces defined by Adobe.

If Exif or XMP timezone support exist, so the same implementation must be provided to have an homogeneous interface everywhere. It that i do when i can with others metadata features between Exif, IPTC and XMP.

In all cases your patch about IPTC sound fine for me.

Gilles
Comment 11 Maik Qualmann 2015-05-29 21:32:04 UTC
Created attachment 92915 [details]
timezone3.patch

New big patch to review.

New class TimeZoneComboBox to reduce double code.
Adding time zone for IPTC sent time.
Adding time zones for XMP.
Corrected date time format for XMP, separator for date time from whitespace to "T" changed.
Example before: 2015-05-29 12:12:00+02:00 to 2015-05-29T12:12:00+02:00

Note: Time zones for EXIF so far I could not find any example, is not specified in all standards.

Maik
Comment 12 caulier.gilles 2015-05-30 05:44:14 UTC
Comment on attachment 92915 [details]
timezone3.patch

Patch sound like fine to apply for next 4.11.0 release

Gilles
Comment 13 Maik Qualmann 2015-05-30 13:57:53 UTC
Git commit 47e85e4276364bb3eea589b5bebd4b5e2b6075ad by Maik Qualmann.
Committed on 30/05/2015 at 13:50.
Pushed by mqualmann into branch 'master'.

apply patch #92915 to read / write and change of time zones from the metadata
FIXED-IN: 4.11.0

M  +2    -2    NEWS
M  +1    -0    metadataedit/CMakeLists.txt
M  +79   -10   metadataedit/iptc/iptcenvelope.cpp
M  +63   -14   metadataedit/iptc/iptcorigin.cpp
M  +74   -12   metadataedit/iptc/iptcproperties.cpp
A  +88   -0    metadataedit/plugin/timezonecombobox.cpp     [License: GPL (v2+)]
A  +52   -0    metadataedit/plugin/timezonecombobox.h     [License: GPL (v2+)]
M  +79   -19   metadataedit/xmp/xmporigin.cpp

http://commits.kde.org/kipi-plugins/47e85e4276364bb3eea589b5bebd4b5e2b6075ad
Comment 14 caulier.gilles 2015-06-03 12:28:48 UTC
Git commit 271d768e920376bef86e420aede515e4ce6308dd by Gilles Caulier.
Committed on 03/06/2015 at 12:28.
Pushed by cgilles into branch 'frameworks'.

backport commit #47e85e4276364bb3eea589b5bebd4b5e2b6075ad from git/master to frameworks branch

M  +1    -1    PORT.KF5/TODO/metadataedit/CMakeLists.txt
M  +84   -15   PORT.KF5/TODO/metadataedit/iptc/iptcenvelope.cpp
M  +66   -17   PORT.KF5/TODO/metadataedit/iptc/iptcorigin.cpp
M  +83   -21   PORT.KF5/TODO/metadataedit/iptc/iptcproperties.cpp
A  +88   -0    PORT.KF5/TODO/metadataedit/plugin/timezonecombobox.cpp     [License: GPL (v2+)]
A  +52   -0    PORT.KF5/TODO/metadataedit/plugin/timezonecombobox.h     [License: GPL (v2+)]
M  +82   -22   PORT.KF5/TODO/metadataedit/xmp/xmporigin.cpp

http://commits.kde.org/kipi-plugins/271d768e920376bef86e420aede515e4ce6308dd