summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/views/editor_helpers.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/views/editor_helpers.py b/core/views/editor_helpers.py
index 179d4a1..91ba01e 100644
--- a/core/views/editor_helpers.py
+++ b/core/views/editor_helpers.py
@@ -94,7 +94,11 @@ def new_image_form(request, path):
exif_dict = piexif.load(i.info["exif"])
i = reorient_image(i, exif_dict)
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:
exif = None