diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2010-05-21 20:04:23 +0200 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2010-05-21 20:04:23 +0200 |
commit | 550dc9ae815cc012a9c8cd755ddb58c496a3a13c (patch) | |
tree | 6fc249d60bfc8bc8f94460aecd20c46791758d2b /src | |
parent | 0ca273f88840e64510b0ed2cd2edcff3ccc05aea (diff) | |
download | pyexiv2-550dc9ae815cc012a9c8cd755ddb58c496a3a13c.tar.gz |
Copy the image comment when copying all the metadata from one image to the other.
Diffstat (limited to 'src')
-rw-r--r-- | src/pyexiv2/metadata.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pyexiv2/metadata.py b/src/pyexiv2/metadata.py index 69822bf..22eb4a9 100644 --- a/src/pyexiv2/metadata.py +++ b/src/pyexiv2/metadata.py @@ -317,7 +317,7 @@ class ImageMetadata(object): size.""" return [Preview(preview) for preview in self._image._previews()] - def copy(self, other, exif=True, iptc=True, xmp=True): + def copy(self, other, exif=True, iptc=True, xmp=True, comment=True): """ Copy the metadata to another image. The metadata in the destination is overridden. In particular, if the @@ -333,6 +333,8 @@ class ImageMetadata(object): :type iptc: boolean :param xmp: whether to copy the XMP metadata :type xmp: boolean + :param comment: whether to copy the image comment + :type comment: boolean """ self._image._copyMetadata(other._image, exif, iptc, xmp) # Empty the cache where needed @@ -345,6 +347,8 @@ class ImageMetadata(object): if xmp: other._keys['xmp'] = None other._tags['xmp'] = {} + if comment: + other.comment = self.comment @property def buffer(self): |