Summary: | digikam sorts pictures with wrong exif tag | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Yuchen Wang <cosmorning> |
Component: | Metadata-Exif | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bluedrago, frederic.coiffier |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 0.9.1 | |
Sentry Crash Report: | |||
Attachments: |
screenshot for digikam 0.9.0
digikam-exif-date.patch |
Description
Yuchen Wang
2006-12-27 04:39:46 UTC
Created attachment 19043 [details]
screenshot for digikam 0.9.0
screenshot for digikam 0.9.0
according to exif spec 2.2: DateTime The date and time of image creation. In this standard it is the date and time the file was changed. DateTimeOriginal The date and time when the original image data was generated. For a DSC the date and time the picture was taken are recorded. Hence I believe when digikam should sort pictures by DateTimeOriginal, NOT DateTime. Agree with you. Looks like datetime used for Date view is taken from database. Wrong data is taken when importing photo into albumdb. Ah... I can confirm it. It's a duplicate of <i><a href="show_bug.cgi?id=135011" title="UNCONFIRMED - Sort images by EXIF date seems buggy for Nikon (or not just Nikon?)">bug 135011</a></i> *** Bug 135011 has been marked as a duplicate of this bug. *** Created attachment 19399 [details]
digikam-exif-date.patch
Proposed patch for DMetadata::getImageDateTime() method to prefer
DateTimeOriginal and DateTimeDigitized before DateTime (which is typically
changed by photo editing software).
I think we should get this in 0.9.1 (together with improvements for Exif/ITPC
sync), but would like to get this reviewed by at least one of more experienced
Digikam developer before committing into SVN.
Luka, This patch is fine for me. You can apply it to svn. Also, you need to make a patch into KipiPlugins::Exiv2Iface class witch is a duplicate code for plugins... Yes, duplicate code is wrong. we need to merge it into a shared libkexiv2 library. Now, like kipi-plugins 0.1.3 is released, i will start this implementation in my computer (:=)))... Gilles SVN commit 627043 by lure: Prefer Exif DateTimeOriginal for sorting images (DateTimeDigitized and DateTime only used as fallback) BUG: 139264 M +2 -1 NEWS M +18 -17 libs/dmetadata/dmetadata.cpp --- trunk/extragear/graphics/digikam/NEWS #627042:627043 @@ -470,6 +470,7 @@ 275 ==> 140320 : View menu should better fit after Edit. 276 ==> 127617 : "Toggle Fullscreen" should be located in "View" menu instead of "Settings" menu. -277 ==> +277 ==> 139264 : Prefer Exif DateTimeOriginal for sorting images (DateTimeDigitized and DateTime only used as fallback) +278 ==> ---------------------------------------------------------------------------------------------------- --- trunk/extragear/graphics/digikam/libs/dmetadata/dmetadata.cpp #627042:627043 @@ -812,25 +812,9 @@ if (!d->exifMetadata.empty()) { - // Try standard Exif date time entry. + // Try Exif date time original. - Exiv2::ExifKey key("Exif.Image.DateTime"); Exiv2::ExifData exifData(d->exifMetadata); - Exiv2::ExifData::iterator it = exifData.findKey(key); - - if (it != exifData.end()) - { - QDateTime dateTime = QDateTime::fromString(it->toString().c_str(), Qt::ISODate); - - if (dateTime.isValid()) - { - // DDebug() << "DateTime (Exif standard): " << dateTime << endl; - return dateTime; - } - } - - // Bogus standard Exif date time entry. Try Exif date time original. - Exiv2::ExifKey key2("Exif.Photo.DateTimeOriginal"); Exiv2::ExifData::iterator it2 = exifData.findKey(key2); @@ -860,6 +844,23 @@ return dateTime; } } + + // Bogus Exif date time digitalized entry. Try standard Exif date time entry. + + Exiv2::ExifKey key("Exif.Image.DateTime"); + Exiv2::ExifData::iterator it = exifData.findKey(key); + + if (it != exifData.end()) + { + QDateTime dateTime = QDateTime::fromString(it->toString().c_str(), Qt::ISODate); + + if (dateTime.isValid()) + { + // DDebug() << "DateTime (Exif standard): " << dateTime << endl; + return dateTime; + } + } + } // In second, trying to get Date & time from Iptc tags. SVN commit 627061 by lure: Prefer Exif DateTimeOriginal for image date/time (DateTimeDigitized and DateTime only used as fallback) CCBUG: 139264 M +7 -0 NEWS M +18 -17 common/exiv2iface/exiv2iface.cpp --- trunk/extragear/libs/kipi-plugins/NEWS #627060:627061 @@ -1,6 +1,13 @@ Note: for details and info about current version, see ChangeLog. +v 0.1.4 beta1 +---------------------------------------------------------------------------- +Kipi-plugins NEW FEATURES + +Kipi-plugins BUG FIXING from B.K.O (http://bugs.kde.org): +001 ==> 139264 : General : Prefer Exif DateTimeOriginal for image date/time (DateTimeDigitized and DateTime only used as fallback) + v 0.1.3 ---------------------------------------------------------------------------- --- trunk/extragear/libs/kipi-plugins/common/exiv2iface/exiv2iface.cpp #627060:627061 @@ -732,25 +732,9 @@ if (!d->exifMetadata.empty()) { - // Try standard Exif date time entry. + // Try Exif date time original. - Exiv2::ExifKey key("Exif.Image.DateTime"); Exiv2::ExifData exifData(d->exifMetadata); - Exiv2::ExifData::iterator it = exifData.findKey(key); - - if (it != exifData.end()) - { - QDateTime dateTime = QDateTime::fromString(it->toString().c_str(), Qt::ISODate); - - if (dateTime.isValid()) - { - // kdDebug() << "DateTime (Exif standard): " << dateTime << endl; - return dateTime; - } - } - - // Bogus standard Exif date time entry. Try Exif date time original. - Exiv2::ExifKey key2("Exif.Photo.DateTimeOriginal"); Exiv2::ExifData::iterator it2 = exifData.findKey(key2); @@ -780,6 +764,23 @@ return dateTime; } } + + // Bogus Exif date time digitized. Try standard Exif date time entry. + + Exiv2::ExifKey key("Exif.Image.DateTime"); + Exiv2::ExifData::iterator it = exifData.findKey(key); + + if (it != exifData.end()) + { + QDateTime dateTime = QDateTime::fromString(it->toString().c_str(), Qt::ISODate); + + if (dateTime.isValid()) + { + // kdDebug() << "DateTime (Exif standard): " << dateTime << endl; + return dateTime; + } + } + } // In second, trying to get Date & time from Iptc tags. *** Bug 137383 has been marked as a duplicate of this bug. *** Actually, I don't agree with the preference of DateTimeOriginal to DateTimeDigitized, at least as long as digiKam "Adjust Time & Date" feature changes only the latter. It often happens that I collect pictures from my friends' cameras that don't have their clocks fully synchronized. Then I would like to adjust (in batches) the dates to that all pictures "fit" together. Currently this is impossible, because digiKam would still sort images using the original date that remains unchanged. Has really nobody encountered this restriction so far? |