diff --git a/src/tiffimage_int.cpp b/src/tiffimage_int.cpp index 58abed0f..4de25d0f 100644 --- a/src/tiffimage_int.cpp +++ b/src/tiffimage_int.cpp @@ -1803,7 +1803,7 @@ EncoderFct TiffMapping::findEncoder(const std::string& make, uint32_t extendedTa } bool TiffTreeStruct::operator==(const TiffTreeStruct::Key& key) const { - return key.r_ == root_ && key.g_ == group_; + return key.first == root_ && key.second == group_; } TiffComponent::UniquePtr TiffCreator::create(uint32_t extendedTag, IfdId group) { @@ -2036,7 +2036,7 @@ bool TiffHeaderBase::isImageTag(uint16_t /*tag*/, IfdId /*group*/, const Primary bool isTiffImageTag(uint16_t tag, IfdId group) { //! List of TIFF image tags - static const TiffImgTagStruct tiffImageTags[] = { + static constexpr TiffImgTagStruct tiffImageTags[] = { {0x00fe, IfdId::ifd0Id}, // Exif.Image.NewSubfileType {0x00ff, IfdId::ifd0Id}, // Exif.Image.SubfileType {0x0100, IfdId::ifd0Id}, // Exif.Image.ImageWidth @@ -2107,7 +2107,7 @@ bool isTiffImageTag(uint16_t tag, IfdId group) { // If tag, group is one of the image tags listed above -> bingo! #ifdef EXIV2_DEBUG_MESSAGES - if (find(tiffImageTags, TiffImgTagStruct::Key(tag, group))) { + if (find(tiffImageTags, TiffImgTagStruct(tag, group))) { ExifKey key(tag, groupName(group)); std::cerr << "Image tag: " << key << " (3)\n"; return true; @@ -2115,7 +2115,7 @@ bool isTiffImageTag(uint16_t tag, IfdId group) { std::cerr << "Not an image tag: " << tag << " (4)\n"; return false; #endif - return find(tiffImageTags, TiffImgTagStruct::Key(tag, group)); + return find(tiffImageTags, TiffImgTagStruct(tag, group)); } TiffHeader::TiffHeader(ByteOrder byteOrder, uint32_t offset, bool hasImageTags) : diff --git a/src/tiffimage_int.hpp b/src/tiffimage_int.hpp index d134cf80..4622fff1 100644 --- a/src/tiffimage_int.hpp +++ b/src/tiffimage_int.hpp @@ -132,19 +132,7 @@ class TiffHeader : public TiffHeaderBase { /*! @brief Data structure used to list image tags for TIFF and TIFF-like images. */ -struct TiffImgTagStruct { - //! Search key for TIFF image tag structure. - using Key = std::pair; - //! Comparison operator to compare a TiffImgTagStruct with a TiffImgTagStruct::Key - bool operator==(const Key& key) const { - auto [t, g] = key; - return g == group_ && t == tag_; - } - - // DATA - uint16_t tag_; //!< Image tag - IfdId group_; //!< Group that contains the image tag -}; // struct TiffImgTagStruct +using TiffImgTagStruct = std::pair; /*! @brief Data structure used as a row (element) of a table (array) @@ -176,7 +164,7 @@ struct TiffGroupStruct { use standard TIFF layout. */ struct TiffTreeStruct { - struct Key; + using Key = std::pair; //! Comparison operator to compare a TiffTreeStruct with a TiffTreeStruct::Key bool operator==(const Key& key) const; @@ -187,15 +175,6 @@ struct TiffTreeStruct { uint32_t parentExtTag_; //!< Parent tag (32 bit so that it can contain special tags) }; -//! Search key for TIFF tree structure. -struct TiffTreeStruct::Key { - //! Constructor - Key(uint32_t r, IfdId g) : r_(r), g_(g) { - } - uint32_t r_; //!< Root - IfdId g_; //!< %Group -}; - /*! @brief TIFF component factory. */