[Digikam-devel] [Bug 103255] wish: *add* (not edit) EXIF headers like date, comment etc
Gilles Caulier
caulier.gilles at free.fr
Mon Oct 23 14:00:16 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 15:00 -------
SVN commit 598385 by cgilles:
kipiplugins from trunk : MetadataEdit plugin: Exif photo informations editor: add White Balance settings
CCBUGS: 103255
M +34 -3 exifphoto.cpp
--- trunk/extragear/libs/kipi-plugins/metadataedit/exifphoto.cpp #598384:598385
@ -80,6 +80,7 @
lightSourceCheck = 0;
focalLengthCheck = 0;
flashModeCheck = 0;
+ whiteBalanceCheck = 0;
apertureCB = 0;
maxApertureCB = 0;
exposureProgramCB = 0;
@ -91,6 +92,7 @
exposureTimeDenEdit = 0;
focalLengthEdit = 0;
flashModeCB = 0;
+ whiteBalanceCB = 0;
flashModeMap.insert(0, FlashMode( 0x00, i18n("No flash") ));
flashModeMap.insert(1, FlashMode( 0x01, i18n("Fired") ));
@ -177,7 +179,7 @
typedef QMap<int, FlashMode> FlashModeMap;
- FlashModeMap flashModeMap;
+ FlashModeMap flashModeMap;
QStringList apertureValues;
@ -191,6 +193,7 @
QCheckBox *lightSourceCheck;
QCheckBox *focalLengthCheck;
QCheckBox *flashModeCheck;
+ QCheckBox *whiteBalanceCheck;
QComboBox *apertureCB;
QComboBox *maxApertureCB;
@ -200,6 +203,7 @
QComboBox *meteringModeCB;
QComboBox *lightSourceCB;
QComboBox *flashModeCB;
+ QComboBox *whiteBalanceCB;
KIntSpinBox *exposureTimeNumEdit;
KIntSpinBox *exposureTimeDenEdit;
@ -212,7 +216,7 @
{
d = new EXIFPhotoPriv;
- QGridLayout* grid = new QGridLayout(parent, 10, 5, KDialog::spacingHint());
+ QGridLayout* grid = new QGridLayout(parent, 11, 5, KDialog::spacingHint());
// --------------------------------------------------------
@ -396,9 +400,21 @
QWhatsThis::add(d->flashModeCB, i18n("<p>Select here the flash program mode used by camera "
"to take the picture."));
+ // --------------------------------------------------------
+
+ d->whiteBalanceCheck = new QCheckBox(i18n("White balance:"), parent);
+ d->whiteBalanceCB = new QComboBox(false, parent);
+ d->whiteBalanceCB->insertItem(i18n("Auto"), 0);
+ d->whiteBalanceCB->insertItem(i18n("Manual"), 1);
+ grid->addMultiCellWidget(d->whiteBalanceCheck, 10, 10, 0, 0);
+ grid->addMultiCellWidget(d->whiteBalanceCB, 10, 10, 2, 5);
+ QWhatsThis::add(d->whiteBalanceCB, i18n("<p>Select here the white balance mode set by camera when "
+ "the picture have been shot."));
+
+
grid->setColStretch(1, 10);
grid->setColStretch(5, 10);
- grid->setRowStretch(10, 10);
+ grid->setRowStretch(11, 10);
// --------------------------------------------------------
@ -435,6 +451,9 @
connect(d->flashModeCheck, SIGNAL(toggled(bool)),
d->flashModeCB, SLOT(setEnabled(bool)));
+ connect(d->whiteBalanceCheck, SIGNAL(toggled(bool)),
+ d->whiteBalanceCB, SLOT(setEnabled(bool)));
+
// --------------------------------------------------------
readMetadata(exifData);
@ -607,6 +626,13 @
}
}
d->flashModeCB->setEnabled(d->flashModeCheck->isChecked());
+
+ if (exiv2Iface.getExifTagLong("Exif.Photo.WhiteBalance", val))
+ {
+ d->whiteBalanceCB->setCurrentItem(val);
+ d->whiteBalanceCheck->setChecked(true);
+ }
+ d->whiteBalanceCB->setEnabled(d->whiteBalanceCheck->isChecked());
}
void EXIFPhoto::applyMetadata(QByteArray& exifData)
@ -712,6 +738,11 @
else
exiv2Iface.removeExifTag("Exif.Photo.Flash");
+ if (d->whiteBalanceCheck->isChecked())
+ exiv2Iface.setExifTagLong("Exif.Photo.WhiteBalance", d->whiteBalanceCB->currentItem());
+ else
+ exiv2Iface.removeExifTag("Exif.Photo.WhiteBalance");
+
exifData = exiv2Iface.getExif();
}
More information about the Digikam-devel
mailing list