[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:40:10 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=b657f8a
The following commit has been merged in the master branch:
commit b657f8a9be055d2d9060fc3595a1033f5ed75035
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Wed Nov 26 09:34:48 2008 +0000
Minor improvements when writing duplicate tags.
---
samples/exifprint.cpp | 4 +++-
src/tiffcomposite.cpp | 3 ++-
src/tiffcomposite_int.hpp | 8 +++++++-
src/tiffvisitor.cpp | 5 +++++
4 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/samples/exifprint.cpp b/samples/exifprint.cpp
index 1ac4e3f..72c2244 100644
--- a/samples/exifprint.cpp
+++ b/samples/exifprint.cpp
@@ -28,7 +28,9 @@ try {
}
Exiv2::ExifData::const_iterator end = exifData.end();
for (Exiv2::ExifData::const_iterator i = exifData.begin(); i != end; ++i) {
- std::cout << std::setw(44) << std::setfill(' ') << std::left
+ std::cout << std::setw(3) << std::right
+ << i->idx() << " "
+ << std::setw(44) << std::setfill(' ') << std::left
<< i->key() << " "
<< "0x" << std::setw(4) << std::setfill('0') << std::right
<< std::hex << i->tag() << " "
diff --git a/src/tiffcomposite.cpp b/src/tiffcomposite.cpp
index e6bb765..4bdb83a 100644
--- a/src/tiffcomposite.cpp
+++ b/src/tiffcomposite.cpp
@@ -1402,7 +1402,8 @@ namespace Exiv2 {
{
assert(lhs != 0);
assert(rhs != 0);
- return lhs->tag() < rhs->tag();
+ if (lhs->tag() != rhs->tag()) return lhs->tag() < rhs->tag();
+ return lhs->idx() < rhs->idx();
}
TiffComponent::AutoPtr newTiffDirectory(uint16_t tag,
diff --git a/src/tiffcomposite_int.hpp b/src/tiffcomposite_int.hpp
index 6b98829..b4ccf71 100644
--- a/src/tiffcomposite_int.hpp
+++ b/src/tiffcomposite_int.hpp
@@ -245,6 +245,12 @@ namespace Exiv2 {
their implementation of writeImage().
*/
uint32_t sizeImage() const;
+ /*!
+ @brief Return the unique id of the entry in the image.
+ */
+ // Todo: This is only implemented in TiffEntryBase. It is needed here so that
+ // we can sort components by tag and idx. Something is not quite right.
+ virtual int idx() const { return 0; }
//@}
protected:
@@ -426,7 +432,7 @@ namespace Exiv2 {
/*!
@brief Return the unique id of the entry in the image
*/
- int idx() const { return idx_; }
+ virtual int idx() const { return idx_; }
/*!
@brief Return a pointer to the binary representation of the
value of this component.
diff --git a/src/tiffvisitor.cpp b/src/tiffvisitor.cpp
index bdd0426..20f90a2 100644
--- a/src/tiffvisitor.cpp
+++ b/src/tiffvisitor.cpp
@@ -646,6 +646,11 @@ namespace Exiv2 {
ed = &(*pos);
}
}
+ else {
+ // For intrusive writing, the index is used to preserve the order of
+ // duplicate tags
+ object->idx_ = ed->idx();
+ }
if (ed) {
const EncoderFct fct = findEncoderFct_(make_, object->tag(), object->group());
if (fct) {
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list