Ver código fonte

Merge pull request #891 from AntoineVe/patch-1

Photos: Handle photos without EXIF data more gracefully
Justin Mayer 7 anos atrás
pai
commit
d6e2c20044
1 arquivos alterados com 5 adições e 1 exclusões
  1. 5 1
      photos/photos.py

+ 5 - 1
photos/photos.py

@@ -259,7 +259,11 @@ def resize_worker(orig, resized, spec, settings):
     im = Image.open(orig)
 
     if ispiexif and settings['PHOTO_EXIF_KEEP'] and im.format == 'JPEG':  # Only works with JPEG exif for sure.
-        im, exif_copy = manipulate_exif(im, settings)
+        try:
+            im, exif_copy = manipulate_exif(im, settings)
+        except:
+            logger.info('photos: no EXIF or EXIF error in {}'.format(orig))
+            exif_copy = b''
     else:
         exif_copy = b''