Commit d5050636 authored by Alberto Mardegan's avatar Alberto Mardegan

Metadata: don't fail on ISO dates

This was found while running the unit tests in a Docker Xenial image.
parent a454549e
......@@ -130,7 +130,9 @@ static inline QDateTime creationData(const Exiv2::Image &image)
const Exiv2::Value *v = lookUp(image, keys);
if (v) {
QString timeString = QString::fromStdString(v->toString());
return QDateTime::fromString(timeString, "yyyy:MM:dd HH:mm:ss");
return timeString.contains('-') ?
QDateTime::fromString(timeString, Qt::ISODate) :
QDateTime::fromString(timeString, "yyyy:MM:dd HH:mm:ss");
} else {
QFileInfo fileInfo(QString::fromStdString(image.io().path()));
return fileInfo.created();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment