Restore modified tags after TZ manipulation

This ensures that Xmp date/times that have been set by the user aren't
over written by the TZ restoration efforts. This fixes bug #1998
main
Jim Easterbrook 4 years ago
parent fde8ed07b3
commit 02ce7e9aff

@ -144,11 +144,6 @@ namespace Exiv2 {
copyExifToXmp(exifData_, xmpData_); copyExifToXmp(exifData_, xmpData_);
copyIptcToXmp(iptcData_, xmpData_); copyIptcToXmp(iptcData_, xmpData_);
// #589 - restore tags which were modified by the convertors
for (auto&& it : copy) {
xmpData_[it.key()] = it.value();
}
// #1112 - restore dates if they lost their TZ info // #1112 - restore dates if they lost their TZ info
for (auto&& date : dates_) { for (auto&& date : dates_) {
std::string sKey = date.first; std::string sKey = date.first;
@ -163,6 +158,11 @@ namespace Exiv2 {
} }
} }
// #589 - restore tags which were modified by the convertors
for (auto&& it : copy) {
xmpData_[it.key()] = it.value();
}
if (XmpParser::encode(xmpPacket_, xmpData_, if (XmpParser::encode(xmpPacket_, xmpData_,
XmpParser::omitPacketWrapper|XmpParser::useCompactFormat) > 1) { XmpParser::omitPacketWrapper|XmpParser::useCompactFormat) > 1) {
#ifndef SUPPRESS_WARNINGS #ifndef SUPPRESS_WARNINGS

Loading…
Cancel
Save