Hi,
Am trying to copy the exif information to the resized image of the same
image using pyexiv2. Searching for a solution i stumbled upon a post in Stack
Overflow<http://stackoverflow.com/questions/400788/resize-image-in-python-without-losing-exif-data>.
It looks like the api's used in the function is outdated and is not
available in the latest version. Based on the latest document i created a
function like this
def write_exif(originFile, destinationFile, **kwargs):
exifInformation = get_exif(originFile)
metadata = pyexiv2.ImageMetadata(str(destinationFile))
for key, value in exifInformation.iteritems():
metadata[key] = value
metadata.write()
def get_exif(file):
"""
Retrieves EXIF information from a image
"""
ret = {}
metadata = pyexiv2.ImageMetadata(str(file))
metadata.read()
info = metadata.exif_keys
for key in info:
data = metadata[key]
ret[key] = data.raw_value
return ret
But this ends up in an error
Python argument types in
_ExifTag._setParentImage(_ExifTag, NoneType)
did not match C++ signature:
_setParentImage(exiv2wrapper::ExifTag {lvalue},
exiv2wrapper::Image {lvalue})
I am now clueless on what went wrong. Could someone please help me out?
Thanks
Swaroop Shankar V
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.