diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2010-09-29 23:12:19 +0200 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2010-09-29 23:12:19 +0200 |
commit | 4915726d25c86b6fd0139092c4679bb4e65ed027 (patch) | |
tree | e15c56605042a1c8d4f18708bc4968609921eb19 /src | |
parent | b2c4364b09beb452c663dab2df87a673e1e9f035 (diff) | |
download | pyexiv2-4915726d25c86b6fd0139092c4679bb4e65ed027.tar.gz |
When deleting a tag, remove its key from the cache too.
Many thanks to Antti Siira for spotting the issue and proposing a patch.
Diffstat (limited to 'src')
-rw-r--r-- | src/pyexiv2/metadata.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pyexiv2/metadata.py b/src/pyexiv2/metadata.py index d5aee36..fea6a6f 100644 --- a/src/pyexiv2/metadata.py +++ b/src/pyexiv2/metadata.py @@ -273,6 +273,8 @@ class ImageMetadata(object): except KeyError: # The tag was not cached. pass + if self._keys['exif'] is not None: + self._keys['exif'].remove(key) def _delete_iptc_tag(self, key): # Delete an IPTC tag. @@ -285,6 +287,8 @@ class ImageMetadata(object): except KeyError: # The tag was not cached. pass + if self._keys['iptc'] is not None: + self._keys['iptc'].remove(key) def _delete_xmp_tag(self, key): # Delete an XMP tag. @@ -297,6 +301,8 @@ class ImageMetadata(object): except KeyError: # The tag was not cached. pass + if self._keys['xmp'] is not None: + self._keys['xmp'].remove(key) def __delitem__(self, key): """ |