本文整理汇总了C++中KPMetadata::setXmp方法的典型用法代码示例。如果您正苦于以下问题:C++ KPMetadata::setXmp方法的具体用法?C++ KPMetadata::setXmp怎么用?C++ KPMetadata::setXmp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KPMetadata
的用法示例。
在下文中一共展示了KPMetadata::setXmp方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply
void XMPEditWidget::apply()
{
if (d->modified && !d->isReadOnly)
{
KPImageInfo info(*d->dlg->currentItem());
if (d->contentPage->syncHOSTCommentIsChecked())
{
info.setDescription(d->contentPage->getXMPCaption());
}
d->contentPage->applyMetadata(d->exifData, d->xmpData);
if (d->originPage->syncHOSTDateIsChecked())
{
info.setDate(d->originPage->getXMPCreationDate());
}
d->originPage->applyMetadata(d->exifData, d->xmpData);
d->subjectsPage->applyMetadata(d->xmpData);
d->keywordsPage->applyMetadata(d->xmpData);
d->categoriesPage->applyMetadata(d->xmpData);
d->creditsPage->applyMetadata(d->xmpData);
d->statusPage->applyMetadata(d->xmpData);
d->propertiesPage->applyMetadata(d->xmpData);
KPMetadata meta;
meta.load((*d->dlg->currentItem()).path());
meta.setExif(d->exifData);
meta.setIptc(d->iptcData);
meta.setXmp(d->xmpData);
meta.save((*d->dlg->currentItem()).path());
d->modified = false;
}
}
示例2: applyMetadata
void XMPContent::applyMetadata(QByteArray& exifData, QByteArray& xmpData)
{
KPMetadata meta;
meta.setExif(exifData);
meta.setXmp(xmpData);
if (d->headlineCheck->isChecked())
meta.setXmpTagString("Xmp.photoshop.Headline", d->headlineEdit->text());
else
meta.removeXmpTag("Xmp.photoshop.Headline");
KPMetadata::AltLangMap oldAltLangMap, newAltLangMap;
if (d->captionEdit->getValues(oldAltLangMap, newAltLangMap))
{
meta.setXmpTagStringListLangAlt("Xmp.dc.description", newAltLangMap, false);
if (syncEXIFCommentIsChecked())
meta.setExifComment(getXMPCaption());
if (syncJFIFCommentIsChecked())
meta.setComments(getXMPCaption().toUtf8());
}
else if (d->captionEdit->isValid())
meta.removeXmpTag("Xmp.dc.description");
if (d->writerCheck->isChecked())
meta.setXmpTagString("Xmp.photoshop.CaptionWriter", d->writerEdit->text());
else
meta.removeXmpTag("Xmp.photoshop.CaptionWriter");
if (d->copyrightEdit->getValues(oldAltLangMap, newAltLangMap))
meta.setXmpTagStringListLangAlt("Xmp.dc.rights", newAltLangMap, false);
else if (d->copyrightEdit->isValid())
meta.removeXmpTag("Xmp.dc.rights");
#if KEXIV2_VERSION >= 0x010000
exifData = meta.getExifEncoded();
#else
exifData = meta.getExif();
#endif
xmpData = meta.getXmp();
}
示例3: readMetadata
void XMPContent::readMetadata(QByteArray& xmpData)
{
blockSignals(true);
KPMetadata meta;
meta.setXmp(xmpData);
KPMetadata::AltLangMap map;
QString data;
d->headlineEdit->clear();
d->headlineCheck->setChecked(false);
data = meta.getXmpTagString("Xmp.photoshop.Headline", false);
if (!data.isNull())
{
d->headlineEdit->setText(data);
d->headlineCheck->setChecked(true);
}
d->headlineEdit->setEnabled(d->headlineCheck->isChecked());
d->captionEdit->setValid(false);
map = meta.getXmpTagStringListLangAlt("Xmp.dc.description", false);
if (!map.isEmpty())
d->captionEdit->setValues(map);
data = meta.getXmpTagString("Xmp.photoshop.CaptionWriter", false);
if (!data.isNull())
{
d->writerEdit->setText(data);
d->writerCheck->setChecked(true);
}
d->writerEdit->setEnabled(d->writerCheck->isChecked());
d->copyrightEdit->setValid(false);
map = meta.getXmpTagStringListLangAlt("Xmp.dc.rights", false);
if (!map.isEmpty())
d->copyrightEdit->setValues(map);
blockSignals(false);
}
示例4: applyMetadata
void XMPOrigin::applyMetadata(QByteArray& exifData, QByteArray& xmpData)
{
KPMetadata meta;
meta.setExif(exifData);
meta.setXmp(xmpData);
if (d->dateCreatedCheck->isChecked())
{
meta.setXmpTagString("Xmp.photoshop.DateCreated",
getXMPCreationDate().toString("yyyy:MM:dd hh:mm:ss"));
meta.setXmpTagString("Xmp.xmp.CreateDate",
getXMPCreationDate().toString("yyyy:MM:dd hh:mm:ss"));
meta.setXmpTagString("Xmp.exif.DateTimeCreated",
getXMPCreationDate().toString("yyyy:MM:dd hh:mm:ss"));
meta.setXmpTagString("Xmp.exif.DateTimeOriginal",
getXMPCreationDate().toString("yyyy:MM:dd hh:mm:ss"));
meta.setXmpTagString("Xmp.tiff.DateTime",
getXMPCreationDate().toString("yyyy:MM:dd hh:mm:ss"));
meta.setXmpTagString("Xmp.xmp.ModifyDate",
getXMPCreationDate().toString("yyyy:MM:dd hh:mm:ss"));
meta.setXmpTagString("Xmp.xmp.MetadataDate",
getXMPCreationDate().toString("yyyy:MM:dd hh:mm:ss"));
if (syncEXIFDateIsChecked())
{
meta.setExifTagString("Exif.Image.DateTime",
getXMPCreationDate().toString(QString("yyyy:MM:dd hh:mm:ss")).toAscii());
}
}
else
{
meta.removeXmpTag("Xmp.photoshop.DateCreated");
meta.removeXmpTag("Xmp.xmp.CreateDate");
meta.removeXmpTag("Xmp.exif.DateTimeCreated");
meta.removeXmpTag("Xmp.exif.DateTimeOriginal");
meta.removeXmpTag("Xmp.tiff.DateTime");
meta.removeXmpTag("Xmp.xmp.ModifyDate");
meta.removeXmpTag("Xmp.xmp.MetadataDate");
}
if (d->dateDigitalizedCheck->isChecked())
meta.setXmpTagString("Xmp.exif.DateTimeDigitized",
d->dateDigitalizedSel->dateTime().toString("yyyy:MM:dd hh:mm:ss"));
else
meta.removeXmpTag("Xmp.exif.DateTimeDigitized");
if (d->cityCheck->isChecked())
meta.setXmpTagString("Xmp.photoshop.City", d->cityEdit->text());
else
meta.removeXmpTag("Xmp.photoshop.City");
if (d->sublocationCheck->isChecked())
meta.setXmpTagString("Xmp.iptc.Location", d->sublocationEdit->text());
else
meta.removeXmpTag("Xmp.iptc.Location");
if (d->provinceCheck->isChecked())
meta.setXmpTagString("Xmp.photoshop.State", d->provinceEdit->text());
else
meta.removeXmpTag("Xmp.photoshop.State");
if (d->countryCheck->isChecked())
{
QString countryName = d->countryCB->currentText().mid(6);
QString countryCode = d->countryCB->currentText().left(3);
meta.setXmpTagString("Xmp.iptc.CountryCode", countryCode);
meta.setXmpTagString("Xmp.photoshop.Country", countryName);
}
else if (d->countryCheck->isValid())
{
meta.removeXmpTag("Xmp.iptc.CountryCode");
meta.removeXmpTag("Xmp.photoshop.Country");
}
#if KEXIV2_VERSION >= 0x010000
exifData = meta.getExifEncoded();
#else
exifData = meta.getExif();
#endif
xmpData = meta.getXmp();
}
示例5: readMetadata
void XMPOrigin::readMetadata(QByteArray& xmpData)
{
blockSignals(true);
KPMetadata meta;
meta.setXmp(xmpData);
QString data;
QStringList code, list;
QDateTime dateTime;
QString dateTimeStr;
dateTimeStr = meta.getXmpTagString("Xmp.photoshop.DateCreated", false);
if (dateTimeStr.isEmpty())
dateTimeStr = meta.getXmpTagString("Xmp.xmp.CreateDate", false);
else if (dateTimeStr.isEmpty())
dateTimeStr = meta.getXmpTagString("Xmp.xmp.ModifyDate", false);
else if (dateTimeStr.isEmpty())
dateTimeStr = meta.getXmpTagString("Xmp.exif.DateTimeCreated", false);
else if (dateTimeStr.isEmpty())
dateTimeStr = meta.getXmpTagString("Xmp.exif.DateTimeOriginal", false);
else if (dateTimeStr.isEmpty())
dateTimeStr = meta.getXmpTagString("Xmp.tiff.DateTime", false);
else if (dateTimeStr.isEmpty())
dateTimeStr = meta.getXmpTagString("Xmp.xmp.ModifyDate", false);
else if (dateTimeStr.isEmpty())
dateTimeStr = meta.getXmpTagString("Xmp.xmp.MetadataDate", false);
d->dateCreatedSel->setDateTime(QDateTime::currentDateTime());
d->dateCreatedCheck->setChecked(false);
if (!dateTimeStr.isEmpty())
{
dateTime = QDateTime::fromString(dateTimeStr, Qt::ISODate);
if (dateTime.isValid())
{
d->dateCreatedSel->setDateTime(dateTime);
d->dateCreatedCheck->setChecked(true);
}
}
d->dateCreatedSel->setEnabled(d->dateCreatedCheck->isChecked());
d->syncHOSTDateCheck->setEnabled(d->dateCreatedCheck->isChecked());
d->syncEXIFDateCheck->setEnabled(d->dateCreatedCheck->isChecked());
dateTimeStr = meta.getXmpTagString("Xmp.exif.DateTimeDigitized", false);
d->dateDigitalizedSel->setDateTime(QDateTime::currentDateTime());
d->dateDigitalizedCheck->setChecked(false);
if (!dateTimeStr.isEmpty())
{
dateTime = QDateTime::fromString(dateTimeStr, Qt::ISODate);
if (dateTime.isValid())
{
d->dateDigitalizedSel->setDateTime(dateTime);
d->dateDigitalizedCheck->setChecked(true);
}
}
d->dateDigitalizedSel->setEnabled(d->dateDigitalizedCheck->isChecked());
d->cityEdit->clear();
d->cityCheck->setChecked(false);
data = meta.getXmpTagString("Xmp.photoshop.City", false);
if (!data.isNull())
{
d->cityEdit->setText(data);
d->cityCheck->setChecked(true);
}
d->cityEdit->setEnabled(d->cityCheck->isChecked());
d->sublocationEdit->clear();
d->sublocationCheck->setChecked(false);
data = meta.getXmpTagString("Xmp.iptc.Location", false);
if (!data.isNull())
{
d->sublocationEdit->setText(data);
d->sublocationCheck->setChecked(true);
}
d->sublocationEdit->setEnabled(d->sublocationCheck->isChecked());
d->provinceEdit->clear();
d->provinceCheck->setChecked(false);
data = meta.getXmpTagString("Xmp.photoshop.State", false);
if (!data.isNull())
{
d->provinceEdit->setText(data);
d->provinceCheck->setChecked(true);
}
d->provinceEdit->setEnabled(d->provinceCheck->isChecked());
d->countryCB->setCurrentIndex(0);
d->countryCheck->setChecked(false);
data = meta.getXmpTagString("Xmp.iptc.CountryCode", false);
if (!data.isNull())
{
int item = -1;
for (int i = 0 ; i < d->countryCB->count() ; ++i)
if (d->countryCB->itemText(i).left(3) == data)
item = i;
if (item != -1)
{
d->countryCB->setCurrentIndex(item);
//.........这里部分代码省略.........