[Digikam-devel] [Bug 127972] digikam does not *add* EXIF:DateTimeOriginal when modifying date

Gilles Caulier caulier.gilles at free.fr
Tue May 30 23:25:46 BST 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=127972         




------- Additional Comments From caulier.gilles free fr  2006-05-31 00:25 -------
SVN commit 546750 by cgilles:

digikam from trunk: patch from Jens B.Benecke about to fix Exif date and Time tags rules depending of context.
CCBUGS: 127972




 M  +9 -5      libs/dmetadata/dmetadata.cpp  
 M  +1 -1      libs/dmetadata/dmetadata.h  
 M  +1 -1      libs/imageproperties/imagedescedittab.cpp  
 M  +1 -1      utilities/cameragui/cameracontroller.cpp  
 M  +6 -5      utilities/cameragui/cameraui.cpp  


--- trunk/extragear/graphics/digikam/libs/dmetadata/dmetadata.cpp #546749:546750
 @ -734,7 +734,7  @
     return QDateTime();
 }
 
-bool DMetadata::setImageDateTime(const QDateTime& dateTime)
+bool DMetadata::setImageDateTime(const QDateTime& dateTime, bool setDateTimeDigitized)
 {
     try
     {    
 @ -746,17 +746,21  @
         // Reference: http://www.exif.org/Exif2-2.PDF, chapter 4.6.5, table 4, section F.
 
         const std::string &exifdatetime(dateTime.toString(Qt::ISODate).ascii());
-        d->exifMetadata["Exif.Photo.DateTimeDigitized"] = exifdatetime;
         d->exifMetadata["Exif.Photo.DateTimeOriginal"]  = exifdatetime;
+        if(setDateTimeDigitized)
+            d->exifMetadata["Exif.Photo.DateTimeDigitized"] = exifdatetime;
         
         // In Second we write date & time into Iptc.
 
         const std::string &iptcdate(dateTime.date().toString(Qt::ISODate).ascii());
-        d->iptcMetadata["Iptc.Application2.DigitizationDate"] = iptcdate;
-        d->iptcMetadata["Iptc.Application2.DateCreated"]      = iptcdate;
         const std::string &iptctime(dateTime.time().toString(Qt::ISODate).ascii());
-        d->iptcMetadata["Iptc.Application2.DigitizationTime"] = iptctime;
+        d->iptcMetadata["Iptc.Application2.DateCreated"] = iptcdate;
         d->iptcMetadata["Iptc.Application2.TimeCreated"]      = iptctime;
+        if(setDateTimeDigitized)
+        {
+            d->iptcMetadata["Iptc.Application2.DigitizationDate"] = iptcdate;
+            d->iptcMetadata["Iptc.Application2.DigitizationTime"] = iptctime;
+        }
         
         setImageProgramId();
         return true;
--- trunk/extragear/graphics/digikam/libs/dmetadata/dmetadata.h #546749:546750
 @ -101,7 +101,7  @
     bool setExifThumbnail(const QImage& thumb);
     bool setImageDimensions(const QSize& size);
     bool setImageOrientation(ImageOrientation orientation);
-    bool setImageDateTime(const QDateTime& dateTime);
+    bool setImageDateTime(const QDateTime& dateTime, bool setDateTimeDigitized = false);
     bool setImageComment(const QString& comment);
     bool setImageRating(int rating);
     bool setImageKeywords(const QStringList& oldKeywords, const QStringList& newKeywords);
--- trunk/extragear/graphics/digikam/libs/imageproperties/imagedescedittab.cpp #546749:546750
 @ -410,7 +410,7  @
         if (AlbumSettings::instance()->getSaveDateTime())
         {
             // Store Image Date & Time as Exif and Iptc tags.
-            metadata.setImageDateTime(d->dateTimeEdit->dateTime());
+            metadata.setImageDateTime(d->dateTimeEdit->dateTime(), false);
         }
 
         if (AlbumSettings::instance()->getSaveIptcRating())
--- trunk/extragear/graphics/digikam/utilities/cameragui/cameracontroller.cpp #546749:546750
 @ -354,7 +354,7  @
                         DMetadata metadata(tempURL.path());
                         
                         if (fixDateTime)
-                            metadata.setImageDateTime(newDateTime);
+                            metadata.setImageDateTime(newDateTime, true);
                         
                         if (setPhotographerId)
                             metadata.setImagePhotographerId(author, authorTitle);
--- trunk/extragear/graphics/digikam/utilities/cameragui/cameraui.cpp #546749:546750
 @ -202,11 +202,11  @
     d->autoRotateCheck  = new QCheckBox(i18n("Rotate/flip image"), exifBox);
     d->autoAlbumCheck   = new QCheckBox(i18n("Date-based sub-albums"), exifBox);
     QWhatsThis::add( d->autoRotateCheck, i18n("<p>Toogle on this option if you want automatically "
-                                              "rotated or fliped images using EXIF informations "
-                                              "provided by camera"));
+                                              "rotated or flipped images using EXIF information "
+                                              "provided by camera."));
     QWhatsThis::add( d->autoAlbumCheck, i18n("<p>Toogle on this option if you want downloaded photos "
                                              "into automatically created date-based sub-albums "
-                                             "of destination album"));
+                                             "of destination album."));
 
     QVGroupBox* OnFlyBox = new QVGroupBox(i18n("On the Fly Operations"), d->advBox);
     d->setPhotographerId = new QCheckBox(i18n("Set default photographer identity"), OnFlyBox);
 @ -216,11 +216,12  @
     
     QWhatsThis::add( d->setPhotographerId, i18n("<p>Toogle on this option to store default photographer identity "
                                                 "into IPTC tags using main digiKam metadata settings."));
-    QWhatsThis::add( d->setCredits, i18n("<p>Toogle on this option to store default credit and copyrigth informations "
+    QWhatsThis::add( d->setCredits, i18n("<p>Toogle on this option to store default credit and copyright information "
                                          "into IPTC tags using main digiKam metadata settings."));
     QWhatsThis::add( d->fixDateTimeCheck, i18n("<p>Toogle on this option to set date and time metadata "
                                                "tags to the right values if your camera don't set "
-                                               "properlly these tags when pictures are taken."));
+                                               "properly these tags when pictures are taken. The values will"
+                                               "be saved in the DateTimeDigitized and DateTimeCreated EXIF/IPTC fields."));
                                                
     grid->addMultiCellWidget(d->renameCustomizer, 0, 0, 0, 1);
     grid->addMultiCellWidget(exifBox, 1, 1, 0, 1);



More information about the Digikam-devel mailing list