fix: move jxl optional import to raster_image.py

This commit is contained in:
Travis Abendshien
2026-07-24 19:01:41 -07:00
parent 8995ef6caf
commit d2bf445a13
2 changed files with 7 additions and 8 deletions
-6
View File
@@ -66,12 +66,6 @@ Image.MAX_IMAGE_PIXELS = None
logger = structlog.get_logger(__name__)
try:
import pillow_jxl # noqa: F401 # pyright: ignore
except ImportError as e:
logger.error('[ThumbRenderer] Could not import the "pillow_jxl" module', error=e)
class ThumbRenderer(QObject):
"""A class for rendering image and file thumbnails."""
+7 -2
View File
@@ -20,11 +20,16 @@ from rawpy import (
from tagstudio.core.utils.types import unwrap
logger = structlog.get_logger(__name__)
try:
import pillow_jxl # noqa: F401 # pyright: ignore
except ImportError as e:
logger.error('[ThumbRenderer] Could not import the "pillow_jxl" module', error=e)
register_heif_opener()
os.environ["OPENCV_IO_ENABLE_OPENEXR"] = "1"
logger = structlog.get_logger(__name__)
def image_thumb(filepath: Path) -> Image.Image | None:
"""Render a thumbnail for a standard image type.