diff --git a/src/xmpsidecar.cpp b/src/xmpsidecar.cpp index 70f26019..1f88b8dd 100644 --- a/src/xmpsidecar.cpp +++ b/src/xmpsidecar.cpp @@ -144,11 +144,6 @@ namespace Exiv2 { copyExifToXmp(exifData_, 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 for (auto&& date : dates_) { 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_, XmpParser::omitPacketWrapper|XmpParser::useCompactFormat) > 1) { #ifndef SUPPRESS_WARNINGS