[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:15:38 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:15 -------
SVN commit 598367 by cgilles:
kipiplugins from trunk : MetadataEdit plugin: Exif photo informations editor: control Shutter Speed Value tag with Exposure Time tag
CCBUGS: 103255
M +24 -1 exifphoto.cpp
--- trunk/extragear/libs/kipi-plugins/metadataedit/exifphoto.cpp #598366:598367
@ -457,7 +457,7 @
d->focalLengthEdit->setValue((double)(num) / (double)(den));
d->focalLengthCheck->setChecked(true);
}
- d->exposureTimeNumEdit->setEnabled(d->focalLengthCheck->isChecked());
+ d->focalLengthEdit->setEnabled(d->focalLengthCheck->isChecked());
if (exiv2Iface.getExifTagRational("Exif.Photo.FNumber", num, den))
{
@ -505,6 +505,18 @
d->exposureTimeDenEdit->setValue(den);
d->exposureTimeCheck->setChecked(true);
}
+ else if (exiv2Iface.getExifTagRational("Exif.Photo.ShutterSpeedValue", num, den))
+ {
+ double tmp = exp(log(2.0) * (double)(num)/(double)(den));
+ if (tmp > 1.0)
+ num = (long int)(tmp + 0.5);
+ else
+ den = (long int)(1.0/tmp + 0.5);
+
+ d->exposureTimeNumEdit->setValue(num);
+ d->exposureTimeDenEdit->setValue(den);
+ d->exposureTimeCheck->setChecked(true);
+ }
d->exposureTimeNumEdit->setEnabled(d->exposureTimeCheck->isChecked());
d->exposureTimeDenEdit->setEnabled(d->exposureTimeCheck->isChecked());
@ -610,10 +622,21 @
exiv2Iface.removeExifTag("Exif.Photo.MaxApertureValue");
if (d->exposureTimeCheck->isChecked())
+ {
exiv2Iface.setExifTagRational("Exif.Photo.ExposureTime", d->exposureTimeNumEdit->value(),
d->exposureTimeDenEdit->value());
+
+ double exposureTime = (double)(d->exposureTimeNumEdit->value())/
+ (double)(d->exposureTimeDenEdit->value());
+ double shutterSpeed = (-1.0)*(log(exposureTime)/log(2.0));
+ exiv2Iface.convertToRational(shutterSpeed, &num, &den, 8);
+ exiv2Iface.setExifTagRational("Exif.Photo.ShutterSpeedValue", num, den);
+ }
else
+ {
exiv2Iface.removeExifTag("Exif.Photo.ExposureTime");
+ exiv2Iface.removeExifTag("Exif.Photo.ShutterSpeedValue");
+ }
if (d->exposureProgramCheck->isChecked())
exiv2Iface.setExifTagLong("Exif.Photo.ExposureProgram", d->exposureProgramCB->currentItem());
More information about the Digikam-devel
mailing list