aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/exiv2wrapper.cpp14
-rw-r--r--src/exiv2wrapper.hpp2
-rw-r--r--src/exiv2wrapper_python.cpp1
-rw-r--r--src/pyexiv2/exif.py4
4 files changed, 21 insertions, 0 deletions
diff --git a/src/exiv2wrapper.cpp b/src/exiv2wrapper.cpp
index ce0c7fc..34abd6d 100644
--- a/src/exiv2wrapper.cpp
+++ b/src/exiv2wrapper.cpp
@@ -481,12 +481,21 @@ ExifTag::ExifTag(const std::string& key): _key(key), _datum(_key)
_sectionName = Exiv2::ExifTags::sectionName(tag, ifd);
_sectionDescription = Exiv2::ExifTags::sectionDesc(tag, ifd);
_raw_value = _datum.toString();
+ if(_datum.getValue().get() != 0)
+ {
+ std::ostringstream buffer;
+ buffer << _datum;
+ _human_value = buffer.str();
+ }
}
void ExifTag::setRawValue(const std::string& value)
{
_datum.setValue(value);
_raw_value = _datum.toString();
+ std::ostringstream buffer;
+ buffer << _datum;
+ _human_value = buffer.str();
}
const std::string ExifTag::getKey()
@@ -534,6 +543,11 @@ const std::string ExifTag::getRawValue()
return _raw_value;
}
+const std::string ExifTag::getHumanValue()
+{
+ return _human_value;
+}
+
IptcTag::IptcTag(const std::string& key): _key(key), _datum(_key)
{
diff --git a/src/exiv2wrapper.hpp b/src/exiv2wrapper.hpp
index 9ea95e4..4098123 100644
--- a/src/exiv2wrapper.hpp
+++ b/src/exiv2wrapper.hpp
@@ -173,6 +173,7 @@ public:
const std::string getSectionName();
const std::string getSectionDescription();
const std::string getRawValue();
+ const std::string getHumanValue();
private:
Exiv2::ExifKey _key;
@@ -185,6 +186,7 @@ private:
std::string _sectionName;
std::string _sectionDescription;
std::string _raw_value;
+ std::string _human_value;
};
diff --git a/src/exiv2wrapper_python.cpp b/src/exiv2wrapper_python.cpp
index 88c1353..11c0eb9 100644
--- a/src/exiv2wrapper_python.cpp
+++ b/src/exiv2wrapper_python.cpp
@@ -89,6 +89,7 @@ BOOST_PYTHON_MODULE(libexiv2python)
.def("_getSectionName", &ExifTag::getSectionName)
.def("_getSectionDescription", &ExifTag::getSectionDescription)
.def("_getRawValue", &ExifTag::getRawValue)
+ .def("_getHumanValue", &ExifTag::getHumanValue)
;
class_<IptcTag>("IptcTag", init<std::string>())
diff --git a/src/pyexiv2/exif.py b/src/pyexiv2/exif.py
index d09bcf3..9a0b0cb 100644
--- a/src/pyexiv2/exif.py
+++ b/src/pyexiv2/exif.py
@@ -160,6 +160,10 @@ class ExifTag(libexiv2python.ExifTag, ListenerInterface):
value = property(fget=_get_value, fset=_set_value, doc=None)
+ @property
+ def human_value(self):
+ return self._getHumanValue() or None
+
# Implement the ListenerInterface
def contents_changed(self):
"""