From 02ce7e9afffb5261cc223a4d66b2d0e1ebc832fa Mon Sep 17 00:00:00 2001 From: Jim Easterbrook Date: Mon, 15 Nov 2021 10:18:05 +0000 Subject: [PATCH] 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 --- src/xmpsidecar.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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