[Digikam-devel] [Bug 103255] wish: *add* (not edit) EXIF headers like date, comment etc

Gilles Caulier caulier.gilles at free.fr
Mon Oct 23 13:43:10 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=103255         




------- Additional Comments From caulier.gilles free fr  2006-10-23 14:43 -------
SVN commit 598380 by cgilles:

kipiplugins from trunk : MetadataEdit plugin: Exif photo informations editor: control Aperture Value tag with FNumber tag

CCBUGS: 103255

 M  +28 -0     exifphoto.cpp  


--- trunk/extragear/libs/kipi-plugins/metadataedit/exifphoto.cpp #598379:598380
 @ -476,6 +476,26  @
             d->apertureCheck->setChecked(true);
         }
     }
+    else if (exiv2Iface.getExifTagRational("Exif.Photo.ApertureValue", num, den))
+    {
+        double aperture = pow(2.0, ((double)(num)/(double)(den))/2.0);
+
+        QString fnumber = QString::number(aperture, 'f', 1);
+
+        int item = -1;
+        for (int i = 0 ; i < d->apertureCB->count() ; i++)
+        {
+            if (d->apertureCB->text(i).remove(0, 2) == fnumber)
+                item = i;
+        }
+
+        if (item != -1)
+        {
+            d->apertureCB->setCurrentItem(item);
+            d->apertureCheck->setChecked(true);
+        }    
+
+    }
     d->apertureCB->setEnabled(d->apertureCheck->isChecked());
     
     if (exiv2Iface.getExifTagRational("Exif.Photo.MaxApertureValue", num, den))
 @ -607,9 +627,17  @
     {
         exiv2Iface.convertToRational(d->apertureCB->currentText().remove(0, 2).toDouble(), &num, &den, 1);
         exiv2Iface.setExifTagRational("Exif.Photo.FNumber", num, den);
+
+        double fnumber  = d->apertureCB->currentText().remove(0, 2).toDouble();
+        double aperture = 2.0*(log(fnumber)/log(2.0));
+        exiv2Iface.convertToRational(aperture, &num, &den, 8);
+        exiv2Iface.setExifTagRational("Exif.Photo.ApertureValue", num, den);
     }
     else
+    {
         exiv2Iface.removeExifTag("Exif.Photo.FNumber");
+        exiv2Iface.removeExifTag("Exif.Photo.ApertureValue");
+    }
 
     if (d->maxApertureCheck->isChecked())
     {



More information about the Digikam-devel mailing list