Bug 406066 - Cannot parse date string YYYY-MM-DDTHH:MM:SS.ssss and YYYY:MM:DD HH:MM:SS in EXIF and XMP
Summary: Cannot parse date string YYYY-MM-DDTHH:MM:SS.ssss and YYYY:MM:DD HH:MM:SS in...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Date (show other bugs)
Version: 6.1.0
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-31 09:03 UTC by Jens
Modified: 2020-01-31 22:08 UTC (History)
2 users (show)

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


Attachments
exiftool JSON export of example image (2.55 KB, application/x-bzip)
2019-04-01 19:19 UTC, Jens
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jens 2019-03-31 09:03:52 UTC
SUMMARY
see $SUBJECT

STEPS TO REPRODUCE
1. import photo with this date string in EXIF metadata or XMP sidecar metadata
2. watch console output

OBSERVED RESULT
Digikam::MetaEngine::Private::printExiv2MessageHandler: Exiv2 ( 2 ) :  Failed to convert Xmp.xmp.ModifyDate to Exif.Image.DateTime (Invalid date string, after day)
Digikam::MetaEngine::Private::printExiv2MessageHandler: Exiv2 ( 2 ) :  Failed to convert Xmp.photoshop.DateCreated to Exif.Photo.DateTimeOriginal (Invalid date string, after day)
Digikam::MetaEngine::Private::printExiv2MessageHandler: Exiv2 ( 2 ) :  Failed to convert Xmp.xmp.CreateDate to Exif.Photo.DateTimeDigitized (Invalid date string, after day)


EXPECTED RESULT
No errors. These dates ("YYYY:MM:DD HH:MM:SS" and "YYYY-MM-DDTHH:MM:SS", optionally with .ssss sub-seconds appended) were created with a CANON IXUS 330 camera (old, but was widely used).


Using most current Git appimage on KDE Neon 18.04 with all current updates applied.
Comment 1 caulier.gilles 2019-03-31 09:06:10 UTC
Can you share your cannon images to test her ?

Gilles Caulier
Comment 2 Maik Qualmann 2019-03-31 09:55:51 UTC
With sample images found on the web this IXUS 330 has no abnormalities, images has normal date format and have no XMP section.

Maik
Comment 3 Jens 2019-04-01 19:19:16 UTC
Created attachment 119202 [details]
exiftool JSON export of example image

Here is an exiftool JSON export which you can reapply to any image. It's the original image exported from Apple iPhoto without modifications (at least the file size and the mtime did not change).

IMHO: Date strings like "YYYY:MM:DD HH:MM:SS" with an optional "+NNNN" or "+NN:00" timezone string appended (without or with space delimited) could be parseable by Digikam without harm even if they are not standard.
Comment 4 Maik Qualmann 2019-04-02 10:40:09 UTC
Json file applied to an empty JPEG file, only normal EXIF metadata of an IXUS camera can be found. There are no abnormalities with the date format. The "Flash" metadata is a struct field, but that's a different topic.

Maik
Comment 5 Maik Qualmann 2019-04-02 12:14:46 UTC
Your problematic date format is the ISO8601 format. After a quick look into the specifications I can not see that the colon is allowed as a date separator, colon is for the time.

Valid are:

YYYYmmdd
YYYY-mm-dd

Maik
Comment 6 Maik Qualmann 2020-01-31 22:08:23 UTC
This problem has been solved, digiKam no longer writes the date in XMP with a colon, but with the hyphen.

Maik