소스 검색

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)