metadata: do not exclude tags that were explicitly selected by the user

(cherry picked from commit 60d862fa72046ecf8f44c2a1677f72237e86e838)
This commit is contained in:
Alberto Griggio 2021-01-26 08:15:36 +01:00 committed by Lawrence Lee
parent ba79d8b7f0
commit 939315f67b
No known key found for this signature in database
GPG Key ID: 048FF2B76A63895F

View File

@ -363,9 +363,10 @@ void Exiv2Metadata::remove_unwanted(Exiv2::ExifData &dst) const
}
for (auto it = dst.begin(); it != dst.end(); ) {
if (badtags.find(it->key()) != badtags.end()) {
int relevant = exif_keys_ ? (exif_keys_->find(it->key()) != exif_keys_->end() ? 1 : 0) : -1;
if (badtags.find(it->key()) != badtags.end() && relevant != 1) {
it = dst.erase(it);
} else if (exif_keys_ && exif_keys_->find(it->key()) == exif_keys_->end()) {
} else if (relevant == 0) {
it = dst.erase(it);
} else {
bool found = false;