Editing exif from an image

1

I need to edit the exif information of an image, such as location and date, for example, but I can not find any library to do this with Python 3.4 and Windows. The most I got was using Pillow to read these properties, however, when I edit and try to save the image as follows:

image.save(path+'/teste.jpg', 'JPEG', exif=tags)

Where tags is a dict, it says that the exif parameter does not accept the dict type, even because it is a binary. I retrieve the exif as follows:

tags = image._getexif()

If I try to save directly with this exif, it will point to the same error, but if I use:

tags = image.info['exif']

I can use tags to save, however it comes in a format that is impossible to edit. So, is there a lib for Windows and Python 3 that solves this problem?

    
asked by anonymous 10.04.2015 / 12:57

1 answer

1

Apparently, a good choice is piexif -

link

I did a quick test here, just installed and read the information in an image. The examples in the documentation show how to get the information and save it back using it in conjunction with the PIL.

The library is pure Python, operating system independent - testing on Pyhon 3.3 on Linux 64bit.

    
15.04.2015 / 16:05