Fixed "priority keys" issue highlighted by Udi Fuchs.

v0.27.3
Andreas Huggel 17 years ago
parent 3967661d04
commit d79bc27e81

@ -52,7 +52,6 @@ EXIV2_RCSID("@(#) $Id$")
#include <iostream>
#include <iomanip>
#include <cassert>
#include <set>
// *****************************************************************************
// class member definitions
@ -375,10 +374,7 @@ namespace Exiv2 {
void TiffDecoder::setExifTag(const ExifKey& key, const Value* pValue, Prio prio)
{
typedef std::set<std::string> PriorityKeys;
static PriorityKeys priorityKeys;
bool isRegPrioTag = (priorityKeys.find(key.key()) != priorityKeys.end());
bool isRegPrioTag = (priorityKeys_.find(key.key()) != priorityKeys_.end());
switch (prio) {
case pvNormal:
@ -388,7 +384,7 @@ namespace Exiv2 {
case pvHigh:
// Register the key as a high prio tag, erase low prio tags, add this
if (!isRegPrioTag) {
priorityKeys.insert(key.key());
priorityKeys_.insert(key.key());
ExifData::iterator pos = exifData_.findKey(key);
while (pos != exifData_.end()) {
exifData_.erase(pos);

@ -42,6 +42,7 @@
#include <iomanip>
#include <cassert>
#include <map>
#include <set>
// *****************************************************************************
// namespace extensions
@ -307,6 +308,11 @@ namespace Exiv2 {
GroupType groupType_; //!< NewSubfileType for each group
bool decodedIptc_; //!< Indicates if IPTC has been decoded yet
//! Type used as the container for "priority keys"
typedef std::set<std::string> PriorityKeys;
PriorityKeys priorityKeys_; //!< Priority keys
}; // class TiffDecoder
/*!

Loading…
Cancel
Save