diff --git a/mapillary_tools/exif_write.py b/mapillary_tools/exif_write.py index 51871de24..c1ad70399 100644 --- a/mapillary_tools/exif_write.py +++ b/mapillary_tools/exif_write.py @@ -182,6 +182,14 @@ def _safe_dump(self) -> bytes: # retry later else: raise exc + except Exception as exc: + zeroth_ifd = self._ef.get("0th", {}) + # workaround: https://github.com/mapillary/mapillary_tools/issues/662 + if piexif.ImageIFD.AsShotNeutral in zeroth_ifd: + del zeroth_ifd[piexif.ImageIFD.AsShotNeutral] + assert piexif.ImageIFD.AsShotNeutral not in zeroth_ifd + else: + raise exc else: break