瀏覽代碼

try except

allan 9 年之前
父節點
當前提交
dcddfd0e3b
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      photos/photos.py

+ 4 - 1
photos/photos.py

@@ -67,9 +67,12 @@ def resize_photos(generator, writer):
             im = Image.open(orig)
             try:
                 exif = im._getexif()
-                icc_profile = im.info.get("icc_profile")
             except Exception:
                 exif = None
+            try:
+                icc_profile = im.info.get("icc_profile")
+            except Exception:
+                icc_profile = None
             if exif:
                 for tag, value in exif.items():
                     decoded = ExifTags.TAGS.get(tag, tag)