aboutsummaryrefslogtreecommitdiffstats
path: root/src/exiv2wrapper.cpp
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2010-01-22 21:00:13 +0100
committerOlivier Tilloy <olivier@tilloy.net>2010-01-22 21:00:13 +0100
commit24b9261f486f68db6166a28f07af510a6830d17b (patch)
tree2458966c5f4ee43c44705a7a0783ecd13ec7b80c /src/exiv2wrapper.cpp
parentbdd8941477e703ccd0240c68767c972f7d81afbe (diff)
downloadpyexiv2-24b9261f486f68db6166a28f07af510a6830d17b.tar.gz
Copy metadata to another image.
From an original patch by Ilpo Nyyssönen (http://iny.iki.fi/).
Diffstat (limited to 'src/exiv2wrapper.cpp')
-rw-r--r--src/exiv2wrapper.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/exiv2wrapper.cpp b/src/exiv2wrapper.cpp
index b6c85cf..ab52892 100644
--- a/src/exiv2wrapper.cpp
+++ b/src/exiv2wrapper.cpp
@@ -404,6 +404,19 @@ boost::python::list Image::previews()
return previews;
}
+void Image::copyMetadata(Image& other, bool exif, bool iptc, bool xmp) const
+{
+ CHECK_METADATA_READ
+ if (!other._dataRead) throw Exiv2::Error(METADATA_NOT_READ);
+
+ if (exif)
+ other._exifData = _exifData;
+ if (iptc)
+ other._iptcData = _iptcData;
+ if (xmp)
+ other._xmpData = _xmpData;
+}
+
ExifTag::ExifTag(const std::string& key, Exiv2::Exifdatum* datum, Exiv2::ExifData* data): _key(key)
{