Championship style exception handling.

This commit is contained in:
2023-07-30 19:11:22 -04:00
parent ea9341642f
commit 605f5bcd6a

View File

@@ -30,6 +30,9 @@ def make_thumbnail(image):
thumb_path.parent.mkdir(parents = True, exist_ok = True) thumb_path.parent.mkdir(parents = True, exist_ok = True)
if not thumb_path.exists(): if not thumb_path.exists():
try:
with Image.open(str(image)) as pilimg: with Image.open(str(image)) as pilimg:
pilimg.thumbnail(THUMB_SIZE) pilimg.thumbnail(THUMB_SIZE)
pilimg.save(str(thumb_path)) pilimg.save(str(thumb_path))
except:
pass