From eb2825e69b9f634acae3c0287fc33281a15261c3 Mon Sep 17 00:00:00 2001 From: Hydrus Network Developer Date: Sat, 5 Aug 2023 15:00:29 -0500 Subject: [PATCH] Quick hack to get things booting without Will make better later --- hydrus/core/HydrusImageHandling.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/hydrus/core/HydrusImageHandling.py b/hydrus/core/HydrusImageHandling.py index 8d512d0d..17680fac 100644 --- a/hydrus/core/HydrusImageHandling.py +++ b/hydrus/core/HydrusImageHandling.py @@ -26,11 +26,20 @@ from PIL import ImageFile as PILImageFile from PIL import Image as PILImage from PIL import ImageCms as PILImageCms -from pillow_heif import register_heif_opener -from pillow_heif import register_avif_opener - -register_heif_opener(thumbnails=False) -register_avif_opener(thumbnails=False) +try: + + from pillow_heif import register_heif_opener + from pillow_heif import register_avif_opener + + register_heif_opener(thumbnails=False) + register_avif_opener(thumbnails=False) + + HEIF_OK = True + +except: + + HEIF_OK = False + from hydrus.core import HydrusConstants as HC from hydrus.core import HydrusData