Bug 414420 - Date/time in sidecar files for Videos seems to be ignored by digikam
Summary: Date/time in sidecar files for Videos seems to be ignored by digikam
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Video (show other bugs)
Version: 6.4.0
Platform: Appimage Linux
: NOR minor
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-23 11:45 UTC by MarcP
Modified: 2019-11-23 16:37 UTC (History)
2 users (show)

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


Attachments
DSCN1382.xmp (4.20 KB, application/octet-stream)
2019-11-23 11:45 UTC, MarcP
Details
DSCN1382.MOV (2.23 MB, video/quicktime)
2019-11-23 11:46 UTC, MarcP
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MarcP 2019-11-23 11:45:28 UTC
Created attachment 124074 [details]
DSCN1382.xmp

SUMMARY

Since metadata in video files cannot be directly written to files, I thought of using XMP sidecar files for correcting their date and add some tags. I don't know if that is a legitimate use of sidecars, but I guess it can't harm.

In any case, most of my video files, specially those from older cameras, have wrong dates. Enabling the option to write to sidecar files in the settings, and using the metadata editor, I can change the three XMP dates for the video files (but not EXIF and IPTC, which are greyed out), and those changes are saved in the sidecar. However, in digikam the video file still shows the older date.

Moreover, I found out that using the "Adjust Time Date" tool, I can also save that date in the EXIF information in the sidecar. Now, I don't know if that makes sense or not, but apparently that info is also saved in the sidecar. In any case, digikam ignores that information as well, and still uses the old date for the video file. 

However, I am pretty sure digikam actually reads the sidecar file, since there is a Tag stored in it, and digikam sees it.

I have attached a sample video file and its sidecar. In digikam, the date reads 2003-01-01, but the real date should be 2004-04-08. If you check the sidecar, you can see the 2004 date in several fields. There is also the tag "Andorra" in the sidecar which digikam seems to read correctly.


STEPS TO REPRODUCE
1. Enable reading and writing to sidecar files in the settings.
2. Select a video file, use the metadata editor, and change the three XMP Dates to some specific day (the three should be the same). Apply changes.
3. Observe how a sidecar has been created, and if you check the contents, the new dates are there.

OBSERVED RESULT
Digikam still uses the old date for that video.

EXPECTED RESULT
Digikam should use the new XMP date for the video file.


SOFTWARE/OS VERSIONS

Linux/KDE Plasma: Digikam 6.4.0 (stable) appimage in Ubuntu 18.04 LTS with Unity DE.
Comment 1 MarcP 2019-11-23 11:46:13 UTC
Created attachment 124075 [details]
DSCN1382.MOV
Comment 2 Maik Qualmann 2019-11-23 14:10:03 UTC
Something does not like Exiv2 on your XMP file. I do not know what, a test here with me with a new XMP file is all right. Who created the XMP first? DigiKam?

digikam.metaengine: Exiv2 ( 2 ) :  Nicht unterstütztes Datumsformat
digikam.metaengine: Exiv2 ( 2 ) :  Nicht unterstütztes Datumsformat
digikam.metaengine: Exiv2 ( 2 ) :  Failed to convert Xmp.xmp.ModifyDate to Exif.Image.DateTime (Invalid date string, after year)
digikam.metaengine: Exiv2 ( 2 ) :  Failed to convert Xmp.photoshop.DateCreated to Exif.Photo.DateTimeOriginal (Invalid date string, after year)
digikam.metaengine: Exiv2 ( 2 ) :  Failed to convert Xmp.xmp.CreateDate to Exif.Photo.DateTimeDigitized (Invalid date string, after year)

Maik
Comment 3 MarcP 2019-11-23 14:12:34 UTC
Yes, that XMP sidecar was created by digikam (version 6.4.0), last week if I recall correctly.
Comment 4 Maik Qualmann 2019-11-23 14:37:46 UTC
There must have been a change to Exiv2 here. For EXIF, Exiv2 expects a ":" as a date separator. For XMP, however, a "-". The colon has always worked, now I have to look into the XMP specifications...

Maik
Comment 5 Maik Qualmann 2019-11-23 15:20:25 UTC
Git commit ef902120bb09dc6ba41923cf03f3890250f906b7 by Maik Qualmann.
Committed on 23/11/2019 at 15:19.
Pushed by mqualmann into branch 'master'.

fix write correct date separator to XMP date

M  +1    -1    core/dplugins/bqm/metadata/timeadjust/timeadjust.cpp
M  +1    -1    core/dplugins/generic/metadata/metadataedit/exif/exifdatetime.cpp
M  +1    -1    core/dplugins/generic/metadata/metadataedit/xmp/xmporigin.cpp
M  +1    -1    core/dplugins/generic/metadata/timeadjust/timeadjustdialog.cpp
M  +1    -1    core/dplugins/generic/metadata/timeadjust/timeadjusttask.cpp

https://invent.kde.org/kde/digikam/commit/ef902120bb09dc6ba41923cf03f3890250f906b7
Comment 6 Maik Qualmann 2019-11-23 16:37:18 UTC
Git commit 3b5351fd690e4eac4965c22847a7c6edd236ce0b by Maik Qualmann.
Committed on 23/11/2019 at 16:36.
Pushed by mqualmann into branch 'master'.

fix update date/time after using Time Adjust tool
FIXED-IN: 7.0.0

M  +2    -1    NEWS
M  +1    -4    core/dplugins/generic/metadata/timeadjust/timeadjustdialog.cpp
M  +0    -4    core/dplugins/generic/metadata/timeadjust/timeadjustdialog.h
M  +13   -1    core/libs/database/utils/ifaces/dbinfoiface.cpp
M  +0    -15   core/libs/database/utils/ifaces/dio.cpp
M  +0    -5    core/libs/database/utils/ifaces/dio.h

https://invent.kde.org/kde/digikam/commit/3b5351fd690e4eac4965c22847a7c6edd236ce0b