diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2010-05-19 19:54:53 +0200 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2010-05-19 19:54:53 +0200 |
commit | 0c2a0abd2ee15ac0d239daa8656347b550bd1d9c (patch) | |
tree | 4f2a4721fb23d393ee4b3ec3e1c59f4c14ab0473 /src/exiv2wrapper.cpp | |
parent | 42e685da4e1811455017914e6bfb01b0ceea3f76 (diff) | |
download | pyexiv2-0c2a0abd2ee15ac0d239daa8656347b550bd1d9c.tar.gz |
Attach the image's ExifData to a tag when it is assigned to an image.
Remove redundant code that would set the value of a tag twice (in the tag itself, and in the image).
Remove the now useless metadata attribute.
Diffstat (limited to 'src/exiv2wrapper.cpp')
-rw-r--r-- | src/exiv2wrapper.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/exiv2wrapper.cpp b/src/exiv2wrapper.cpp index cc2d455..c579b87 100644 --- a/src/exiv2wrapper.cpp +++ b/src/exiv2wrapper.cpp @@ -281,13 +281,6 @@ const ExifTag Image::getExifTag(std::string key) return ExifTag(key, &_exifData[key], &_exifData); } -void Image::setExifTagValue(std::string key, std::string value) -{ - CHECK_METADATA_READ - - _exifData[key] = value; -} - void Image::deleteExifTag(std::string key) { CHECK_METADATA_READ @@ -571,6 +564,15 @@ void ExifTag::setRawValue(const std::string& value) _datum->setValue(value); } +void ExifTag::setParentImage(Image& image) +{ + _data = image.getExifData(); + std::string value = _datum->toString(); + delete _datum; + _datum = &(*_data)[_key.key()]; + _datum->setValue(value); +} + const std::string ExifTag::getKey() { return _key.key(); |