|
|
|
@ -408,7 +408,7 @@ bool KExiv2::save(const TQString& filePath)
|
|
|
|
|
// TIFF/EP Raw files based are supported by Exiv2 0.18 as experimental. We will do touch it for the moment.
|
|
|
|
|
// Metadata writing is supported in implementation from svn trunk.
|
|
|
|
|
TQString rawTiffBased("dng nef pef 3fr arw cr2 dcr erf k25 kdc mos orf raw sr2 srf");
|
|
|
|
|
if (rawTiffBased.tqcontains(finfo.extension(false).lower()))
|
|
|
|
|
if (rawTiffBased.contains(finfo.extension(false).lower()))
|
|
|
|
|
{
|
|
|
|
|
qDebug("'%s' is TIFF based RAW file and writing mode is disable with this libkexiv2 version. Metadata not saved.",
|
|
|
|
|
finfo.fileName().ascii());
|
|
|
|
@ -462,7 +462,7 @@ bool KExiv2::save(const TQString& filePath)
|
|
|
|
|
|
|
|
|
|
for (Exiv2::ExifData::iterator it = d->exifMetadata.begin(); it != d->exifMetadata.end(); ++it)
|
|
|
|
|
{
|
|
|
|
|
if (!untouchedTags.tqcontains(it->key().c_str()))
|
|
|
|
|
if (!untouchedTags.contains(it->key().c_str()))
|
|
|
|
|
{
|
|
|
|
|
exif[it->key().c_str()] = d->exifMetadata[it->key().c_str()];
|
|
|
|
|
}
|
|
|
|
@ -1003,7 +1003,7 @@ KExiv2::ImageColorWorkSpace KExiv2::getImageColorWorkSpace() const
|
|
|
|
|
{
|
|
|
|
|
// Nikon camera set Exif.Photo.ColorSpace to uncalibrated and
|
|
|
|
|
// Exif.Nikon3.ColorMode to "MODE2" when users work in AdobRGB color space.
|
|
|
|
|
if (getExifTagString("Exif.Nikon3.ColorMode").tqcontains("MODE2"))
|
|
|
|
|
if (getExifTagString("Exif.Nikon3.ColorMode").contains("MODE2"))
|
|
|
|
|
return WORKSPACE_ADOBERGB;
|
|
|
|
|
|
|
|
|
|
// TODO : add more Makernote parsing here ...
|
|
|
|
@ -1289,7 +1289,7 @@ TQString KExiv2::getExifTagString(const char* exifTagName, bool escapeCR) const
|
|
|
|
|
TQString tagValue = TQString::fromLocal8Bit(os.str().c_str());
|
|
|
|
|
#endif
|
|
|
|
|
if (escapeCR)
|
|
|
|
|
tagValue.tqreplace("\n", " ");
|
|
|
|
|
tagValue.replace("\n", " ");
|
|
|
|
|
|
|
|
|
|
return tagValue;
|
|
|
|
|
}
|
|
|
|
@ -1335,7 +1335,7 @@ TQString KExiv2::getIptcTagString(const char* iptcTagName, bool escapeCR) const
|
|
|
|
|
TQString tagValue = TQString::fromLocal8Bit(os.str().c_str());
|
|
|
|
|
|
|
|
|
|
if (escapeCR)
|
|
|
|
|
tagValue.tqreplace("\n", " ");
|
|
|
|
|
tagValue.replace("\n", " ");
|
|
|
|
|
|
|
|
|
|
return tagValue;
|
|
|
|
|
}
|
|
|
|
@ -1700,18 +1700,18 @@ KExiv2::MetaDataMap KExiv2::getExifTagsDataList(const TQStringList &exifKeysFilt
|
|
|
|
|
// Exif tag contents can be an i18n strings, no only simple ascii.
|
|
|
|
|
tagValue = TQString::fromLocal8Bit(os.str().c_str());
|
|
|
|
|
}
|
|
|
|
|
tagValue.tqreplace("\n", " ");
|
|
|
|
|
tagValue.replace("\n", " ");
|
|
|
|
|
|
|
|
|
|
// We apply a filter to get only the Exif tags that we need.
|
|
|
|
|
|
|
|
|
|
if (!invertSelection)
|
|
|
|
|
{
|
|
|
|
|
if (exifKeysFilter.tqcontains(key.section(".", 1, 1)))
|
|
|
|
|
if (exifKeysFilter.contains(key.section(".", 1, 1)))
|
|
|
|
|
metaDataMap.insert(key, tagValue);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (!exifKeysFilter.tqcontains(key.section(".", 1, 1)))
|
|
|
|
|
if (!exifKeysFilter.contains(key.section(".", 1, 1)))
|
|
|
|
|
metaDataMap.insert(key, tagValue);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1748,16 +1748,16 @@ KExiv2::MetaDataMap KExiv2::getIptcTagsDataList(const TQStringList &iptcKeysFilt
|
|
|
|
|
os << *md;
|
|
|
|
|
TQString value = TQString::fromAscii(os.str().c_str());
|
|
|
|
|
// To make a string just on one line.
|
|
|
|
|
value.tqreplace("\n", " ");
|
|
|
|
|
value.replace("\n", " ");
|
|
|
|
|
|
|
|
|
|
// Some IPTC key are redondancy. check if already one exist...
|
|
|
|
|
MetaDataMap::iterator it = metaDataMap.tqfind(key);
|
|
|
|
|
MetaDataMap::iterator it = metaDataMap.find(key);
|
|
|
|
|
|
|
|
|
|
// We apply a filter to get only the Exif tags that we need.
|
|
|
|
|
|
|
|
|
|
if (!invertSelection)
|
|
|
|
|
{
|
|
|
|
|
if (iptcKeysFilter.tqcontains(key.section(".", 1, 1)))
|
|
|
|
|
if (iptcKeysFilter.contains(key.section(".", 1, 1)))
|
|
|
|
|
{
|
|
|
|
|
if (it == metaDataMap.end())
|
|
|
|
|
metaDataMap.insert(key, value);
|
|
|
|
@ -1766,13 +1766,13 @@ KExiv2::MetaDataMap KExiv2::getIptcTagsDataList(const TQStringList &iptcKeysFilt
|
|
|
|
|
TQString v = *it;
|
|
|
|
|
v.append(", ");
|
|
|
|
|
v.append(value);
|
|
|
|
|
metaDataMap.tqreplace(key, v);
|
|
|
|
|
metaDataMap.replace(key, v);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (!iptcKeysFilter.tqcontains(key.section(".", 1, 1)))
|
|
|
|
|
if (!iptcKeysFilter.contains(key.section(".", 1, 1)))
|
|
|
|
|
{
|
|
|
|
|
if (it == metaDataMap.end())
|
|
|
|
|
metaDataMap.insert(key, value);
|
|
|
|
@ -1781,7 +1781,7 @@ KExiv2::MetaDataMap KExiv2::getIptcTagsDataList(const TQStringList &iptcKeysFilt
|
|
|
|
|
TQString v = *it;
|
|
|
|
|
v.append(", ");
|
|
|
|
|
v.append(value);
|
|
|
|
|
metaDataMap.tqreplace(key, v);
|
|
|
|
|
metaDataMap.replace(key, v);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -2164,7 +2164,7 @@ bool KExiv2::setImageKeywords(const TQStringList& oldKeywords, const TQStringLis
|
|
|
|
|
|
|
|
|
|
// Also remove new keywords to avoid duplicates. They will be added again below.
|
|
|
|
|
if ( key == TQString("Iptc.Application2.Keywords") &&
|
|
|
|
|
(oldKeywords.tqcontains(val) || newKeywords.tqcontains(val))
|
|
|
|
|
(oldKeywords.contains(val) || newKeywords.contains(val))
|
|
|
|
|
)
|
|
|
|
|
it = iptcData.erase(it);
|
|
|
|
|
else
|
|
|
|
@ -2248,7 +2248,7 @@ bool KExiv2::setImageSubjects(const TQStringList& oldSubjects, const TQStringLis
|
|
|
|
|
TQString key = TQString::fromLocal8Bit(it->key().c_str());
|
|
|
|
|
TQString val(it->toString().c_str());
|
|
|
|
|
|
|
|
|
|
if (key == TQString("Iptc.Application2.Subject") && oldDef.tqcontains(val))
|
|
|
|
|
if (key == TQString("Iptc.Application2.Subject") && oldDef.contains(val))
|
|
|
|
|
it = iptcData.erase(it);
|
|
|
|
|
else
|
|
|
|
|
++it;
|
|
|
|
@ -2331,7 +2331,7 @@ bool KExiv2::setImageSubCategories(const TQStringList& oldSubCategories, const T
|
|
|
|
|
TQString key = TQString::fromLocal8Bit(it->key().c_str());
|
|
|
|
|
TQString val(it->toString().c_str());
|
|
|
|
|
|
|
|
|
|
if (key == TQString("Iptc.Application2.SuppCategory") && oldSubCategories.tqcontains(val))
|
|
|
|
|
if (key == TQString("Iptc.Application2.SuppCategory") && oldSubCategories.contains(val))
|
|
|
|
|
it = iptcData.erase(it);
|
|
|
|
|
else
|
|
|
|
|
++it;
|
|
|
|
|