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 committed by ed
parent 1ebe06f51e
commit a407eb9269

View file

@ -113,14 +113,17 @@ except:
try: try:
if os.environ.get("PRTY_NO_VIPS"): if os.environ.get("PRTY_NO_VIPS"):
raise Exception() raise ImportError()
HAVE_VIPS = True HAVE_VIPS = True
import pyvips import pyvips
logging.getLogger("pyvips").setLevel(logging.WARNING) logging.getLogger("pyvips").setLevel(logging.WARNING)
except: except Exception as e:
HAVE_VIPS = False HAVE_VIPS = False
if not isinstance(e, ImportError):
logging.warning("libvips found, but failed to load: " + str(e))
try: try:
if os.environ.get("PRTY_NO_RAW"): if os.environ.get("PRTY_NO_RAW"):