metadata: do not copy Exif tags with 0 count

Tentative fix for #147

(cherry picked from commit 12f699df10c1c0854c0e882db151560a1f4f3a26)
This commit is contained in:
Alberto Griggio 2020-12-12 17:10:45 +01:00 committed by Lawrence Lee
parent 92befa7e81
commit d16bc6f6ea
No known key found for this signature in database
GPG Key ID: 048FF2B76A63895F

View File

@ -230,7 +230,12 @@ void Exiv2Metadata::saveToImage(const Glib::ustring &path, bool preserve_all_tag
if (!preserve_all_tags) {
remove_unwanted(srcexif);
}
dst->setExifData(srcexif);
//dst->setExifData(srcexif);
for (auto &tag : srcexif) {
if (tag.count() > 0) {
dst->exifData()[tag.key()] = tag;
}
}
} else {
dst->setExifData(exif_data_);
dst->setIptcData(iptc_data_);