[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:41:57 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=a0bdc55
The following commit has been merged in the master branch:
commit a0bdc5528e2c63b47f22bca3dd4ddd5fa8176dd6
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Sun Sep 19 10:57:47 2010 +0000
#721: Removed Exif-specific reference functions from the ExifKey interface again.
---
samples/key-test.cpp | 9 +++++----
src/exif.cpp | 2 +-
src/tags.cpp | 50 ++++++++++++++++++++++----------------------------
src/tags.hpp | 26 +++++++++++---------------
4 files changed, 39 insertions(+), 48 deletions(-)
diff --git a/samples/key-test.cpp b/samples/key-test.cpp
index 7ce78f3..807f98d 100644
--- a/samples/key-test.cpp
+++ b/samples/key-test.cpp
@@ -14,6 +14,7 @@
#include <iostream>
#include <string>
+#include <cstring>
using namespace Exiv2;
@@ -59,13 +60,13 @@ int main()
}
// ifdName
tc += 1;
- if (std::string(ek.ifdName()) != "Iop") {
+ if (std::string(ExifTags::ifdName(ek.groupName())) != "Iop") {
std::cout << "Testcase failed (ifdName: " << std::endl;
rc += 1;
}
// sectionName
tc += 1;
- if (ek.sectionName() != "Interoperability") {
+ if (strcmp(ExifTags::sectionName(ek), "Interoperability") != 0) {
std::cout << "Testcase failed (sectionName)" << std::endl;
rc += 1;
}
@@ -109,13 +110,13 @@ int main()
}
// ifdName
tc += 1;
- if (std::string(ek2.ifdName()) != "Iop") {
+ if (std::string(ExifTags::ifdName(ek2.groupName())) != "Iop") {
std::cout << "Testcase failed (ifdName: " << std::endl;
rc += 1;
}
// sectionName
tc += 1;
- if (ek2.sectionName() != "Interoperability") {
+ if (strcmp(ExifTags::sectionName(ek2), "Interoperability") != 0) {
std::cout << "Testcase failed (sectionName)" << std::endl;
rc += 1;
}
diff --git a/src/exif.cpp b/src/exif.cpp
index fe71de9..1fe153f 100644
--- a/src/exif.cpp
+++ b/src/exif.cpp
@@ -354,7 +354,7 @@ namespace Exiv2 {
const char* Exifdatum::ifdName() const
{
- return key_.get() == 0 ? "" : key_->ifdName();
+ return key_.get() == 0 ? "" : Internal::ifdName(static_cast<Internal::IfdId>(key_->ifdId()));
}
int Exifdatum::idx() const
diff --git a/src/tags.cpp b/src/tags.cpp
index 93a74d9..c394071 100644
--- a/src/tags.cpp
+++ b/src/tags.cpp
@@ -2640,6 +2640,26 @@ namespace Exiv2 {
return ii->tagList_();
} // ExifTags::tagList
+ const char* ExifTags::sectionName(const ExifKey& key)
+ {
+ const TagInfo* ti = tagInfo(key.tag(), static_cast<Internal::IfdId>(key.ifdId()));
+ if (ti == 0) return sectionInfo[unknownTag.sectionId_].name_;
+ return sectionInfo[ti->sectionId_].name_;
+ }
+
+ uint16_t ExifTags::defaultCount(const ExifKey& key)
+ {
+ const TagInfo* ti = tagInfo(key.tag(), static_cast<Internal::IfdId>(key.ifdId()));
+ if (ti == 0) return unknownTag.count_;
+ return ti->count_;
+ }
+
+ const char* ExifTags::ifdName(const std::string& groupName)
+ {
+ IfdId ifdId = Internal::groupId(groupName);
+ return Internal::ifdName(ifdId);
+ }
+
bool ExifTags::isMakerGroup(const std::string& groupName)
{
IfdId ifdId = Internal::groupId(groupName);
@@ -2795,17 +2815,6 @@ namespace Exiv2 {
p_->makeKey(tag, ifdId, ti);
}
- ExifKey::ExifKey(const TagInfo& tagInfo)
- : p_(new Impl)
- {
- IfdId ifdId = static_cast<IfdId>(tagInfo.ifdId_);
- if (!Internal::isExifIfd(ifdId) && !Internal::isMakerIfd(ifdId)) {
- throw Error(23, ifdId);
- }
- p_->groupName_ = Exiv2::groupName(ifdId);
- p_->makeKey(tagInfo.tag_, ifdId, &tagInfo);
- }
-
ExifKey::ExifKey(const std::string& key)
: p_(new Impl)
{
@@ -2850,11 +2859,6 @@ namespace Exiv2 {
return p_->groupName_;
}
- const char* ExifKey::ifdName() const
- {
- return Internal::ifdName(p_->ifdId_);
- }
-
std::string ExifKey::tagName() const
{
return p_->tagName();
@@ -2878,12 +2882,6 @@ namespace Exiv2 {
return p_->tagInfo_->typeId_;
}
- uint16_t ExifKey::defaultCount() const
- {
- if (p_->tagInfo_ == 0) return unknownTag.count_;
- return p_->tagInfo_->count_;
- }
-
uint16_t ExifKey::tag() const
{
return p_->tag_;
@@ -2904,11 +2902,6 @@ namespace Exiv2 {
return p_->ifdId_;
}
- std::string ExifKey::sectionName() const
- {
- return sectionInfo[p_->tagInfo_->sectionId_].name_;
- }
-
int ExifKey::idx() const
{
return p_->idx_;
@@ -2919,7 +2912,8 @@ namespace Exiv2 {
std::ostream& operator<<(std::ostream& os, const TagInfo& ti)
{
- ExifKey exifKey(ti);
+
+ ExifKey exifKey(ti.tag_, Internal::groupName(static_cast<Internal::IfdId>(ti.ifdId_)));
return os << exifKey.tagName() << ", "
<< std::dec << exifKey.tag() << ", "
<< "0x" << std::setw(4) << std::setfill('0')
diff --git a/src/tags.hpp b/src/tags.hpp
index d709502..3c2610a 100644
--- a/src/tags.hpp
+++ b/src/tags.hpp
@@ -47,6 +47,7 @@ namespace Exiv2 {
// *****************************************************************************
// class declarations
class ExifData;
+ class ExifKey;
class Value;
struct TagInfo;
@@ -123,6 +124,13 @@ namespace Exiv2 {
//! Print the list of tags for \em groupName
static void taglist(std::ostream& os, const std::string& groupName);
+ //! Return the name of the section for an Exif \em key.
+ static const char* sectionName(const ExifKey& key);
+ //! Return the default number of components (not bytes!) \em key has. (0=any, -1=count not known)
+ static uint16_t defaultCount(const ExifKey& key);
+ //! Return the name of the IFD for the group.
+ static const char* ifdName(const std::string& groupName);
+
/*!
@brief Return true if \em groupName is a makernote group.
*/
@@ -165,12 +173,6 @@ namespace Exiv2 {
and group name.
*/
ExifKey(uint16_t tag, const std::string& groupName);
- /*!
- @brief Constructor to create an Exif key from a tag info structure
- @param tagInfo The tag info structure
- @throw Error if the key cannot be constructed from the tag info structure
- */
- explicit ExifKey(const TagInfo& tagInfo);
//! Copy constructor
ExifKey(const ExifKey& rhs);
//! Destructor
@@ -192,23 +194,17 @@ namespace Exiv2 {
virtual std::string key() const;
virtual const char* familyName() const;
virtual std::string groupName() const;
+ //! Return the IFD id as an integer. (Do not use, this is meant for library internal use.)
+ int ifdId() const;
virtual std::string tagName() const;
+ virtual uint16_t tag() const;
virtual std::string tagLabel() const;
//! Return the tag description.
std::string tagDesc() const; // Todo: should be in the base class
//! Return the default type id for this tag.
TypeId defaultTypeId() const; // Todo: should be in the base class
- //! Return the default number of components (not bytes!) this tag has. (0=any, -1=count not known)
- uint16_t defaultCount() const;
- virtual uint16_t tag() const;
AutoPtr clone() const;
- //! Return the IFD id as an integer. (Do not use, this is meant for library internal use.)
- int ifdId() const;
- //! Return the name of the IFD
- const char* ifdName() const;
- //! Return the name of the Exif section (deprecated)
- std::string sectionName() const;
//! Return the index (unique id of this key within the original Exif data, 0 if not set)
int idx() const;
//@}
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list