[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:09 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=7a6907c
The following commit has been merged in the master branch:
commit 7a6907c10dd056c1bdacb31d6d4b4dfa17d85614
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Sun Nov 23 13:23:53 2008 +0000
Fixed conversion special case: do not add an empty Exif datum if the (std) conversion failed.
---
src/convert.cpp | 8 ++++++--
src/exif.cpp | 4 ++--
src/exif.hpp | 5 +++--
src/iptc.cpp | 4 ++--
src/iptc.hpp | 4 ++--
src/metadatum.hpp | 4 ++--
src/xmp.cpp | 4 ++--
src/xmp.hpp | 4 ++--
8 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/src/convert.cpp b/src/convert.cpp
index cc17fca..11f53fc 100644
--- a/src/convert.cpp
+++ b/src/convert.cpp
@@ -750,7 +750,11 @@ namespace Exiv2 {
return;
}
// Todo: Escape non-ASCII characters in XMP text values
- (*exifData_)[to] = value;
+ ExifKey key(to);
+ Exifdatum ed(key);
+ if (0 == ed.setValue(value)) {
+ exifData_->add(ed);
+ }
if (erase_) xmpData_->erase(pos);
}
@@ -793,10 +797,10 @@ namespace Exiv2 {
void Converter::cnvXmpDate(const char* from, const char* to)
{
-#ifdef EXV_HAVE_XMP_TOOLKIT
Exiv2::XmpData::iterator pos = xmpData_->findKey(XmpKey(from));
if (pos == xmpData_->end()) return;
if (!prepareExifTarget(to)) return;
+#ifdef EXV_HAVE_XMP_TOOLKIT
std::string value = pos->toString();
if (!pos->value().ok()) {
#ifndef SUPPRESS_WARNINGS
diff --git a/src/exif.cpp b/src/exif.cpp
index 9d6cd7a..79df27d 100644
--- a/src/exif.cpp
+++ b/src/exif.cpp
@@ -261,13 +261,13 @@ namespace Exiv2 {
if (pValue) value_ = pValue->clone();
}
- void Exifdatum::setValue(const std::string& value)
+ int Exifdatum::setValue(const std::string& value)
{
if (value_.get() == 0) {
TypeId type = ExifTags::tagType(tag(), ifdId());
value_ = Value::create(type);
}
- value_->read(value);
+ return value_->read(value);
}
ExifThumbC::ExifThumbC(const ExifData& exifData)
diff --git a/src/exif.hpp b/src/exif.hpp
index c637365..341e2f9 100644
--- a/src/exif.hpp
+++ b/src/exif.hpp
@@ -132,9 +132,10 @@ namespace Exiv2 {
@brief Set the value to the string \em value. Uses Value::read(const
std::string&). If the %Exifdatum does not have a Value yet,
then a %Value of the correct type for this %Exifdatum is
- created. An AsciiValue is created for unknown tags.
+ created. An AsciiValue is created for unknown tags. Return
+ 0 if the value was read successfully.
*/
- void setValue(const std::string& value);
+ int setValue(const std::string& value);
/*!
@brief Set the data area by copying (cloning) the buffer pointed to
by \em buf.
diff --git a/src/iptc.cpp b/src/iptc.cpp
index 632b632..59c73ab 100644
--- a/src/iptc.cpp
+++ b/src/iptc.cpp
@@ -135,13 +135,13 @@ namespace Exiv2 {
if (pValue) value_ = pValue->clone();
}
- void Iptcdatum::setValue(const std::string& value)
+ int Iptcdatum::setValue(const std::string& value)
{
if (value_.get() == 0) {
TypeId type = IptcDataSets::dataSetType(tag(), record());
value_ = Value::create(type);
}
- value_->read(value);
+ return value_->read(value);
}
Iptcdatum& IptcData::operator[](const std::string& key)
diff --git a/src/iptc.hpp b/src/iptc.hpp
index 2b0989a..465a2ff 100644
--- a/src/iptc.hpp
+++ b/src/iptc.hpp
@@ -106,9 +106,9 @@ namespace Exiv2 {
If the %Iptcdatum does not have a Value yet, then a %Value of
the correct type for this %Iptcdatum is created. If that
fails (because of an unknown dataset), a StringValue is
- created.
+ created. Return 0 if the value was read successfully.
*/
- void setValue(const std::string& value);
+ int setValue(const std::string& value);
//@}
//! @name Accessors
diff --git a/src/metadatum.hpp b/src/metadatum.hpp
index 939da17..2a6d7b9 100644
--- a/src/metadatum.hpp
+++ b/src/metadatum.hpp
@@ -151,9 +151,9 @@ namespace Exiv2 {
@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 one is created. See subclasses for
- more details.
+ more details. Return 0 if the value was read successfully.
*/
- virtual void setValue(const std::string& buf) =0;
+ virtual int setValue(const std::string& buf) =0;
//@}
//! @name Accessors
diff --git a/src/xmp.cpp b/src/xmp.cpp
index 0df374e..c408b24 100644
--- a/src/xmp.cpp
+++ b/src/xmp.cpp
@@ -273,7 +273,7 @@ namespace Exiv2 {
if (pValue) p_->value_ = pValue->clone();
}
- void Xmpdatum::setValue(const std::string& value)
+ int Xmpdatum::setValue(const std::string& value)
{
if (p_->value_.get() == 0) {
TypeId type = xmpText;
@@ -282,7 +282,7 @@ namespace Exiv2 {
}
p_->value_ = Value::create(type);
}
- p_->value_->read(value);
+ return p_->value_->read(value);
}
Xmpdatum& XmpData::operator[](const std::string& key)
diff --git a/src/xmp.hpp b/src/xmp.hpp
index fc3b63f..d8e15bd 100644
--- a/src/xmp.hpp
+++ b/src/xmp.hpp
@@ -115,9 +115,9 @@ namespace Exiv2 {
std::string&). If the %Xmpdatum does not have a Value yet,
then a %Value of the correct type for this %Xmpdatum is
created. If the key is unknown, a XmpTextValue is used as
- default.
+ default. Return 0 if the value was read successfully.
*/
- void setValue(const std::string& value);
+ int setValue(const std::string& value);
//@}
//! @name Accessors
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list