hMatoba / Piexif

Exif manipulation with pure python script.
MIT License
369 stars 82 forks source link

Library is unpacking partial strings from fields #89

Open dave7280 opened 5 years ago

dave7280 commented 5 years ago

Python: 2.7 && 3.7

When i use following code on image taken by apple iPhone:

exif_dict = piexif.load('source.jpg')

for ifd in ("0th", "Exif", "GPS", "1st"):
    for tag in exif_dict[ifd]:
        print(ifd, piexif.TAGS[ifd][tag]["name"], exif_dict[ifd][tag])

I get output that is truncating exif fields, like make:

0th Make b'Appl'

instead of "Apple" which exiftool clearly prints for that image.

Why is the library truncating the characters? It doesn't happen in one field but in more.