[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:01 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=9cf3e66
The following commit has been merged in the master branch:
commit 9cf3e66801158833eefebc4ace09f38b6b1da675
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Tue Feb 10 02:39:34 2004 +0000
Fixed blunders related to non-intrusive writing: Ambiguous Ifd constructor, incomplete implementation of updateIfds
---
src/exif.cpp | 43 +++++++++++++++++++++++++++++++------------
src/exif.hpp | 31 +++++++++++++++++++++++++++----
2 files changed, 58 insertions(+), 16 deletions(-)
diff --git a/src/exif.cpp b/src/exif.cpp
index cfbf9ac..c1abc3e 100644
--- a/src/exif.cpp
+++ b/src/exif.cpp
@@ -20,13 +20,13 @@
*/
/*
File: exif.cpp
- Version: $Name: $ $Revision: 1.17 $
+ Version: $Name: $ $Revision: 1.18 $
Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
History: 26-Jan-04, ahu: created
*/
// *****************************************************************************
#include "rcsid.hpp"
-EXIV2_RCSID("@(#) $Name: $ $Revision: 1.17 $ $RCSfile: exif.cpp,v $")
+EXIV2_RCSID("@(#) $Name: $ $Revision: 1.18 $ $RCSfile: exif.cpp,v $")
// *****************************************************************************
// included header files
@@ -541,6 +541,16 @@ namespace Exif {
size_ = value.size();
type_ = value.typeId();
count_ = value.count();
+ } // Entry::setValue
+
+ Ifd::Ifd(IfdId ifdId)
+ : alloc_(true), ifdId_(ifdId), offset_(0), next_(0)
+ {
+ }
+
+ Ifd::Ifd(IfdId ifdId, uint32 offset)
+ : alloc_(true), ifdId_(ifdId), offset_(offset), next_(0)
+ {
}
Ifd::Ifd(IfdId ifdId, uint32 offset, bool alloc)
@@ -820,7 +830,7 @@ namespace Exif {
} // Ifd::print
Thumbnail::Thumbnail()
- : type_(none), size_(0), image_(0), ifd_(ifd1, false)
+ : type_(none), size_(0), image_(0), ifd_(ifd1, 0, false)
{
}
@@ -830,7 +840,7 @@ namespace Exif {
}
Thumbnail::Thumbnail(const Thumbnail& rhs)
- : type_(rhs.type_), size_(rhs.size_), image_(0), ifd_(ifd1, false)
+ : type_(rhs.type_), size_(rhs.size_), image_(0), ifd_(ifd1, 0, false)
{
if (rhs.image_ > 0 && rhs.size_ > 0) {
image_ = new char[rhs.size_];
@@ -1126,9 +1136,9 @@ namespace Exif {
} // Thumbnail::setTiffImageOffsets
ExifData::ExifData()
- : ifd0_(ifd0, false), exifIfd_(exifIfd, false), iopIfd_(iopIfd, false),
- gpsIfd_(gpsIfd, false), ifd1_(ifd1, false), valid_(false),
- size_(0), data_(0)
+ : ifd0_(ifd0, 0, false), exifIfd_(exifIfd, 0, false),
+ iopIfd_(iopIfd, 0, false), gpsIfd_(gpsIfd, 0, false),
+ ifd1_(ifd1, 0, false), valid_(false), size_(0), data_(0)
{
}
@@ -1407,14 +1417,24 @@ std::cout << "->>>>>> writing from metadata <<<<<<-
";
if (!this->compatible()) return false;
bool compatible = true;
+ compatible |= updateIfd(ifd0_);
+ compatible |= updateIfd(exifIfd_);
+ compatible |= updateIfd(iopIfd_);
+ compatible |= updateIfd(gpsIfd_);
+ compatible |= updateIfd(ifd1_);
- Ifd& ifd = ifd0_;
+ return compatible;
+ } // ExifData::updateIfds
+
+ bool ExifData::updateIfd(Ifd& ifd)
+ {
+ if (ifd.alloc()) throw Error("Invariant violated in ExifData::updateIfd");
+
+ bool compatible = true;
Ifd::iterator end = ifd.end();
for (Ifd::iterator entry = ifd.begin(); entry != end; ++entry) {
-
// find the corresponding metadatum
std::string key = ExifTags::makeKey(entry->tag(), entry->ifdId());
-
const_iterator md = findKey(key);
if (md == this->end()) {
// corresponding metadatum was deleted: this is not (yet) a
@@ -1424,9 +1444,8 @@ std::cout << "->>>>>> writing from metadata <<<<<<-
";
}
entry->setValue(md->value(), byteOrder());
}
-
return compatible;
- }
+ } // ExifData::updateIfd
bool ExifData::compatible() const
{
diff --git a/src/exif.hpp b/src/exif.hpp
index 5a6dc1c..0536fb4 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.17 $
+ @version $Name: $ $Revision: 1.18 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel at gmx.net">ahuggel at gmx.net</a>
@date 09-Jan-04, ahu: created
@@ -784,10 +784,22 @@ namespace Exif {
class Ifd {
public:
/*!
- @brief Constructor. Allows to set the IFD identifier and choose
- whether or not memory management is required for the Entries.
+ @brief Constructor. Allows to set the IFD identifier. Memory management
+ is enabled, offset is set to 0. Serves as default constructor.
*/
- explicit Ifd(IfdId ifdId =ifdIdNotSet, uint32 offset =0, bool alloc =true);
+ explicit Ifd(IfdId ifdId =ifdIdNotSet);
+ /*!
+ @brief Constructor. Allows to set the IFD identifier and the offset of
+ the IFD from the start of TIFF header. Memory management is
+ enabled.
+ */
+ Ifd(IfdId ifdId, uint32 offset);
+ /*!
+ @brief Constructor. Allows to set the IFD identifier, offset of the
+ IFD from the start of TIFF header and choose whether or not
+ memory management is required for the Entries.
+ */
+ Ifd(IfdId ifdId, uint32 offset, bool alloc);
//! Entries const iterator type
typedef Entries::const_iterator const_iterator;
@@ -904,6 +916,8 @@ namespace Exif {
long offset() const { return offset_; }
//! Get the offset to the next IFD from the start of the TIFF header
long next() const { return next_; }
+ //! Get the memory allocation mode
+ bool alloc() const { return alloc_; }
//@}
//! Get the size of this IFD in bytes (IFD only, without data)
long size() const;
@@ -1046,6 +1060,10 @@ namespace Exif {
*/
class ExifData {
+ // Copying not allowed (Todo: implement me!)
+ ExifData(const ExifData& rhs);
+ // Assignment not allowed (Todo: implement me!)
+ ExifData& operator=(const ExifData& rhs);
public:
//! Default constructor
ExifData();
@@ -1180,6 +1198,11 @@ namespace Exif {
*/
bool updateIfds();
/*
+ Update the metadata of one IFD. Called by updateIfds() for each
+ of the internal IFDs.
+ */
+ bool updateIfd(Ifd& ifd);
+ /*
Check if the metadata is compatible with the internal IFDs for
non-intrusive writing. Return true if compatible, false if not.
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list