Championship style exception handling.
This commit is contained in:
@@ -30,6 +30,9 @@ def make_thumbnail(image):
|
||||
thumb_path.parent.mkdir(parents = True, exist_ok = True)
|
||||
|
||||
if not thumb_path.exists():
|
||||
try:
|
||||
with Image.open(str(image)) as pilimg:
|
||||
pilimg.thumbnail(THUMB_SIZE)
|
||||
pilimg.save(str(thumb_path))
|
||||
except:
|
||||
pass
|
||||
|
Reference in New Issue
Block a user