2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-22 07:11:52 +00:00

cope with bad exif error

This commit is contained in:
Philip Sargent 2023-10-20 14:00:38 +03:00
parent a823a7b2d8
commit 423347dbe5

View File

@ -94,7 +94,11 @@ def new_image_form(request, path):
exif_dict = piexif.load(i.info["exif"]) exif_dict = piexif.load(i.info["exif"])
i = reorient_image(i, exif_dict) i = reorient_image(i, exif_dict)
exif_dict['Exif'][41729] = b'1' exif_dict['Exif'][41729] = b'1'
exif = piexif.dump(exif_dict) # can crash here with bad exif data
try:
exif = piexif.dump(exif_dict)
except:
exif = None
else: else:
exif = None exif = None