Skip to content

Commit 8c90f21

Browse files
authored
fix: catch NotImplementedError for Float16 JPEG-XL files (#849)
1 parent e0fb731 commit 8c90f21

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/tagstudio/qt/widgets/preview/preview_thumb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def _update_image(self, filepath: Path, ext: str) -> dict:
213213
image = Image.open(str(filepath))
214214
stats["width"] = image.width
215215
stats["height"] = image.height
216-
except (UnidentifiedImageError, FileNotFoundError) as e:
216+
except (UnidentifiedImageError, FileNotFoundError, NotImplementedError) as e:
217217
logger.error("[PreviewThumb] Could not get image stats", filepath=filepath, error=e)
218218
elif MediaCategories.is_ext_in_category(
219219
ext, MediaCategories.IMAGE_VECTOR_TYPES, mime_fallback=True

src/tagstudio/qt/widgets/thumb_renderer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,7 @@ def _image_thumb(self, filepath: Path) -> Image.Image:
818818
except (
819819
UnidentifiedImageError,
820820
DecompressionBombError,
821+
NotImplementedError,
821822
) as e:
822823
logger.error("Couldn't render thumbnail", filepath=filepath, error=type(e).__name__)
823824
return im

0 commit comments

Comments
 (0)