LeoHsiao1 / pyexiv2

Read and write image metadata, including EXIF, IPTC, XMP, ICC Profile.
GNU General Public License v3.0
197 stars 39 forks source link

Unable to read exift data! #61

Closed claudiaximenaro closed 3 years ago

claudiaximenaro commented 3 years ago

Hi, I have a problem with reading the exif and iptc data from *.png files. When I use Exiftool, I can see that the information is there, however when I use pyexiv2 my exif/iptc data dictionaries are empty, it only happens with png files, for the rest (jpg,tiff,) it works.

LeoHsiao1 commented 3 years ago

pyexiv2 supports reading and writing Exif, IPTC amd XMP metadata from PNG images. For example:

leo@Leo:/mnt/d$ python3
Python 3.8.2 (default, Jul 16 2020, 14:00:26)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyexiv2
>>> img = pyexiv2.Image('1.png')
>>> img.modify_exif({'Exif.Image.Artist': 'TEST'})
>>> img.read_exif()
{'Exif.Image.Artist': 'TEST'}
>>> img.modify_iptc({'Iptc.Application2.ObjectName': 'TEST'})
>>> img.read_iptc()
{'Iptc.Application2.ObjectName': 'TEST'}

You can try to read images with exiv2.

claudiaximenaro commented 3 years ago

Thank you. Indeed pyexif2 supports png files, the problem seems to come from the photos that are very dated (2010) and at that time PNG didn't have a formal EXIF chunk, so what I am seeing with exiftool is actually the information coming from the xmp data that was added later.

github-actions[bot] commented 2 years ago

This issue has been automatically closed because there has been no activity for a month.