From 899ff6979881a1cf27fb725a666737275055ad51 Mon Sep 17 00:00:00 2001 From: mat Date: Tue, 12 Aug 2025 12:31:23 -0300 Subject: [PATCH] warn if failed to import pyvips pyvips uses `ffi.callback()`, which fails on on some systems --- copyparty/th_srv.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/copyparty/th_srv.py b/copyparty/th_srv.py index b37591c6..945c6d56 100644 --- a/copyparty/th_srv.py +++ b/copyparty/th_srv.py @@ -113,14 +113,17 @@ except: try: if os.environ.get("PRTY_NO_VIPS"): - raise Exception() + raise ImportError() HAVE_VIPS = True import pyvips logging.getLogger("pyvips").setLevel(logging.WARNING) -except: +except Exception as e: HAVE_VIPS = False + if not isinstance(e, ImportError): + logging.warning("libvips found, but failed to load: " + str(e)) + try: if os.environ.get("PRTY_NO_RAW"):