hMatoba / Piexif

Exif manipulation with pure python script.
MIT License
367 stars 81 forks source link

KeyError in dump() if Interop is present and Exif is not #114

Open dtantsur opened 3 years ago

dtantsur commented 3 years ago

From _dump.py:

    if (("Exif" in exif_dict) and len(exif_dict["Exif"]) or
          ("Interop" in exif_dict) and len(exif_dict["Interop"]) ):  # <-- this permits missing Exif because of "or"
        zeroth_ifd[ImageIFD.ExifTag] = 1
        exif_is = True
        exif_ifd = exif_dict["Exif"]  # <-- this requires Exif

Not sure if it's expected or not, but Nikola has this case in its docs: https://getnikola.com/handbook.html#preserve-some-exif-data