[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:37:16 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=c32e706
The following commit has been merged in the master branch:
commit c32e706c3657e3276da2f3a3cd43566148d95dbc
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Sat Oct 8 11:34:32 2005 +0000
Changed Value::read() to return an int indicating success instead of throwing. Added Support for HHMMSS and H:M:S formats to TimeValue (assumes timezone is UTC). Fixes bug #440.
---
src/actions.cpp | 18 +++---
src/iptc.cpp | 16 +++---
src/value.cpp | 172 +++++++++++++++++++++++++++++++++++++++-----------------
src/value.hpp | 79 +++++++++++++++++---------
4 files changed, 192 insertions(+), 93 deletions(-)
diff --git a/src/actions.cpp b/src/actions.cpp
index f8f02dc..be94076 100644
--- a/src/actions.cpp
+++ b/src/actions.cpp
@@ -1065,12 +1065,13 @@ namespace Action {
<< ")" << std::endl;
}
Exiv2::Value::AutoPtr value = Exiv2::Value::create(modifyCmd.typeId_);
- value->read(modifyCmd.value_);
- if (modifyCmd.metadataId_ == exif) {
- image_->exifData().add(Exiv2::ExifKey(modifyCmd.key_), value.get());
- }
- if (modifyCmd.metadataId_ == iptc) {
- image_->iptcData().add(Exiv2::IptcKey(modifyCmd.key_), value.get());
+ if (0 == value->read(modifyCmd.value_)) {
+ if (modifyCmd.metadataId_ == exif) {
+ image_->exifData().add(Exiv2::ExifKey(modifyCmd.key_), value.get());
+ }
+ if (modifyCmd.metadataId_ == iptc) {
+ image_->iptcData().add(Exiv2::IptcKey(modifyCmd.key_), value.get());
+ }
}
}
@@ -1100,8 +1101,9 @@ namespace Action {
if (modifyCmd.explicitType_ || value.get() == 0) {
value = Exiv2::Value::create(modifyCmd.typeId_);
}
- value->read(modifyCmd.value_);
- metadatum->setValue(value.get());
+ if (0 == value->read(modifyCmd.value_)) {
+ metadatum->setValue(value.get());
+ }
}
void Modify::delMetadatum(const ModifyCmd& modifyCmd)
diff --git a/src/iptc.cpp b/src/iptc.cpp
index 4bea042..a53b097 100644
--- a/src/iptc.cpp
+++ b/src/iptc.cpp
@@ -136,7 +136,6 @@ namespace Exiv2 {
const byte* pRead = buf;
iptcMetadata_.clear();
- int rc = 0;
uint16_t record = 0;
uint16_t dataSet = 0;
uint32_t sizeData = 0;
@@ -166,12 +165,11 @@ namespace Exiv2 {
sizeData = getUShort(pRead, bigEndian);
pRead += 2;
}
- rc = readData(dataSet, record, pRead, sizeData);
- if( rc ) return rc;
+ readData(dataSet, record, pRead, sizeData);
pRead += sizeData;
}
- return rc;
+ return 0;
} // IptcData::read
int IptcData::readData(uint16_t dataSet, uint16_t record,
@@ -180,10 +178,12 @@ namespace Exiv2 {
Value::AutoPtr value;
TypeId type = IptcDataSets::dataSetType(dataSet, record);
value = Value::create(type);
- value->read(data, sizeData, bigEndian);
- IptcKey key(dataSet, record);
- add(key, value.get());
- return 0;
+ int rc = value->read(data, sizeData, bigEndian);
+ if (0 == rc) {
+ IptcKey key(dataSet, record);
+ add(key, value.get());
+ }
+ return rc;
}
DataBuf IptcData::copy()
diff --git a/src/value.cpp b/src/value.cpp
index b3a6e58..1a43c22 100644
--- a/src/value.cpp
+++ b/src/value.cpp
@@ -130,13 +130,14 @@ namespace Exiv2 {
return *this;
}
- void DataValue::read(const byte* buf, long len, ByteOrder byteOrder)
+ int DataValue::read(const byte* buf, long len, ByteOrder byteOrder)
{
// byteOrder not needed
value_.assign(buf, buf + len);
+ return 0;
}
- void DataValue::read(const std::string& buf)
+ int DataValue::read(const std::string& buf)
{
std::istringstream is(buf);
int tmp;
@@ -144,6 +145,7 @@ namespace Exiv2 {
while (is >> tmp) {
value_.push_back(static_cast<byte>(tmp));
}
+ return 0;
}
long DataValue::copy(byte* buf, ByteOrder byteOrder) const
@@ -181,15 +183,17 @@ namespace Exiv2 {
return *this;
}
- void StringValueBase::read(const std::string& buf)
+ int StringValueBase::read(const std::string& buf)
{
value_ = buf;
+ return 0;
}
- void StringValueBase::read(const byte* buf, long len, ByteOrder byteOrder)
+ int StringValueBase::read(const byte* buf, long len, ByteOrder byteOrder)
{
// byteOrder not needed
value_ = std::string(reinterpret_cast<const char*>(buf), len);
+ return 0;
}
long StringValueBase::copy(byte* buf, ByteOrder byteOrder) const
@@ -229,10 +233,11 @@ namespace Exiv2 {
return *this;
}
- void AsciiValue::read(const std::string& buf)
+ int AsciiValue::read(const std::string& buf)
{
value_ = buf;
if (value_[value_.size()-1] != '
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list