From 8c90f21c13a7700f11d1fcc4611894fc817ecb17 Mon Sep 17 00:00:00 2001 From: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com> Date: Mon, 10 Mar 2025 00:58:09 -0700 Subject: [PATCH] fix: catch NotImplementedError for Float16 JPEG-XL files (#849) --- src/tagstudio/qt/widgets/preview/preview_thumb.py | 2 +- src/tagstudio/qt/widgets/thumb_renderer.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tagstudio/qt/widgets/preview/preview_thumb.py b/src/tagstudio/qt/widgets/preview/preview_thumb.py index 000debd3..fbc6c485 100644 --- a/src/tagstudio/qt/widgets/preview/preview_thumb.py +++ b/src/tagstudio/qt/widgets/preview/preview_thumb.py @@ -213,7 +213,7 @@ class PreviewThumb(QWidget): image = Image.open(str(filepath)) stats["width"] = image.width stats["height"] = image.height - except (UnidentifiedImageError, FileNotFoundError) as e: + except (UnidentifiedImageError, FileNotFoundError, NotImplementedError) as e: logger.error("[PreviewThumb] Could not get image stats", filepath=filepath, error=e) elif MediaCategories.is_ext_in_category( ext, MediaCategories.IMAGE_VECTOR_TYPES, mime_fallback=True diff --git a/src/tagstudio/qt/widgets/thumb_renderer.py b/src/tagstudio/qt/widgets/thumb_renderer.py index c73dbaa4..ec9c7715 100644 --- a/src/tagstudio/qt/widgets/thumb_renderer.py +++ b/src/tagstudio/qt/widgets/thumb_renderer.py @@ -818,6 +818,7 @@ class ThumbRenderer(QObject): except ( UnidentifiedImageError, DecompressionBombError, + NotImplementedError, ) as e: logger.error("Couldn't render thumbnail", filepath=filepath, error=type(e).__name__) return im