warn if failed to import pyvips

pyvips uses `ffi.callback()`, which fails on on some systems
This commit is contained in:
mat 2025-08-12 12:31:23 -03:00
parent 1ebe06f51e
commit 899ff69798
No known key found for this signature in database

View file

@ -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"):