[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:36:08 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=6c389a7
The following commit has been merged in the master branch:
commit 6c389a708bb5ee5948535951985192714454e036
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Tue Mar 9 05:43:08 2004 +0000
Fixed TIFF thumbnail bug in Thumbnail::updateTiffImage
---
src/exif.cpp | 41 ++++++++++++++++++++++++++++++-----------
src/exif.hpp | 6 +++++-
2 files changed, 35 insertions(+), 12 deletions(-)
diff --git a/src/exif.cpp b/src/exif.cpp
index cd77e27..d6d5f0a 100644
--- a/src/exif.cpp
+++ b/src/exif.cpp
@@ -20,14 +20,14 @@
*/
/*
File: exif.cpp
- Version: $Name: $ $Revision: 1.27 $
+ Version: $Name: $ $Revision: 1.28 $
Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
History: 26-Jan-04, ahu: created
11-Feb-04, ahu: isolated as a component
*/
// *****************************************************************************
#include "rcsid.hpp"
-EXIV2_RCSID("@(#) $Name: $ $Revision: 1.27 $ $RCSfile: exif.cpp,v $")
+EXIV2_RCSID("@(#) $Name: $ $Revision: 1.28 $ $RCSfile: exif.cpp,v $")
// *****************************************************************************
// included header files
@@ -125,6 +125,13 @@ namespace Exif {
value_ = value->clone();
}
+ void Metadatum::setValue(const Entry& e, ByteOrder byteOrder)
+ {
+ delete value_;
+ value_ = Value::create(TypeId(e.type()));
+ value_->read(e.data(), e.count() * e.typeSize(), byteOrder);
+ }
+
void Metadatum::setValue(const std::string& buf)
{
if (value_ == 0) value_ = Value::create(asciiString);
@@ -354,14 +361,26 @@ namespace Exif {
void Thumbnail::updateTiffImage(ExifData& exifData) const
{
// Create metadata from the StripOffsets and StripByteCounts entries
- // and add these to the Exif data, replacing existing entries
- Ifd::const_iterator pos = ifd_.findTag(0x0111);
- if (pos == ifd_.end()) throw Error("Bad thumbnail (0x0111)");
- exifData.add(Metadatum(*pos, tiffHeader_.byteOrder()));
+ // and update the Exif data accordingly
+ Entries::const_iterator entry = ifd_.findTag(0x0111);
+ if (entry == ifd_.end()) throw Error("Bad thumbnail (0x0111)");
+ ExifData::iterator md = exifData.findIfdIdIdx(entry->ifdId(), entry->idx());
+ if (md == exifData.end()) {
+ exifData.add(Metadatum(*entry, tiffHeader_.byteOrder()));
+ }
+ else {
+ md->setValue(*entry, tiffHeader_.byteOrder());
+ }
- pos = ifd_.findTag(0x0117);
- if (pos == ifd_.end()) throw Error("Bad thumbnail (0x0117)");
- exifData.add(Metadatum(*pos, tiffHeader_.byteOrder()));
+ entry = ifd_.findTag(0x0117);
+ if (entry == ifd_.end()) throw Error("Bad thumbnail (0x0117)");
+ md = exifData.findIfdIdIdx(entry->ifdId(), entry->idx());
+ if (md == exifData.end()) {
+ exifData.add(Metadatum(*entry, tiffHeader_.byteOrder()));
+ }
+ else {
+ md->setValue(*entry, tiffHeader_.byteOrder());
+ }
} // Thumbnail::updateTiffImage
@@ -589,7 +608,7 @@ namespace Exif {
if (updateEntries()) {
//ahu Todo: remove debugging output
-std::cout << "->>>>>> using non-intrusive writing <<<<<<-
";
+std::cerr << "->>>>>> using non-intrusive writing <<<<<<-
";
memcpy(buf, data_, size_);
size = size_;
@@ -598,7 +617,7 @@ std::cout << "->>>>>> using non-intrusive writing <<<<<<-
";
else {
//ahu Todo: remove debugging output
-std::cout << "->>>>>> writing from metadata <<<<<<-
";
+std::cerr << "->>>>>> writing from metadata <<<<<<-
";
size = copyFromMetadata(buf);
}
diff --git a/src/exif.hpp b/src/exif.hpp
index 7ee5836..a238986 100644
--- a/src/exif.hpp
+++ b/src/exif.hpp
@@ -21,7 +21,7 @@
/*!
@file exif.hpp
@brief Encoding and decoding of %Exif data
- @version $Name: $ $Revision: 1.27 $
+ @version $Name: $ $Revision: 1.28 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel at gmx.net">ahuggel at gmx.net</a>
@date 09-Jan-04, ahu: created
@@ -97,6 +97,10 @@ namespace Exif {
*/
void setValue(const Value* value);
/*!
+ @brief Set the value from an IFD entry.
+ */
+ void setValue(const Entry& e, ByteOrder byteOrder);
+ /*!
@brief Set the value to the string buf.
Uses Value::read(const std::string& buf). If the metadatum does
not have a value yet, then an AsciiValue is created.
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list