From f1e0c44bdd52461e612920ef4d2d83447b69bd20 Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 20 Sep 2022 23:25:35 +0200 Subject: [PATCH] better autocorrect for poor ffmpeg builds --- copyparty/ico.py | 2 +- copyparty/th_srv.py | 30 ++++++++++++++++++++---------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/copyparty/ico.py b/copyparty/ico.py index 3ef812de..89973e88 100644 --- a/copyparty/ico.py +++ b/copyparty/ico.py @@ -45,7 +45,7 @@ class Ico(object): pb = ImageDraw.Draw(img) tw, th = pb.textsize(ext) pb.text(((w - tw) // 2, (h - th) // 2), ext, fill="#" + c[6:]) - img = img.resize((w * 3, h * 3), Image.Resampling.NEAREST) + img = img.resize((w * 3, h * 3), Image.NEAREST) buf = BytesIO() img.save(buf, format="PNG", compress_level=1) diff --git a/copyparty/th_srv.py b/copyparty/th_srv.py index 8a1d6e15..75d9051f 100644 --- a/copyparty/th_srv.py +++ b/copyparty/th_srv.py @@ -266,13 +266,14 @@ class ThumbSrv(object): if fun: try: fun(abspath, tpath) - except: + except Exception as ex: msg = "{} could not create thumbnail of {}\n{}" msg = msg.format(fun.__name__, abspath, min_ex()) c: Union[str, int] = 1 if "