Add ".psd" to IMAGE_TYPES; Handle ID3NoHeaderError

This commit is contained in:
Travis Abendshien
2024-06-13 16:35:23 -07:00
parent 10d81b3fa1
commit 087176edae
3 changed files with 7 additions and 2 deletions

View File

@@ -33,6 +33,7 @@ IMAGE_TYPES: list[str] = [
".jp2",
".j2k",
".jpg2",
".psd",
]
RAW_IMAGE_TYPES: list[str] = [
".raw",

View File

@@ -358,7 +358,7 @@ class ItemThumb(FlowWidget):
def set_extension(self, ext: str) -> None:
if ext and ext.startswith(".") is False:
ext = "." + ext
if ext and ext not in IMAGE_TYPES or ext in [".gif", ".apng"]:
if ext and ext not in IMAGE_TYPES or ext in [".gif", ".apng", ".psd"]:
self.ext_badge.setHidden(False)
self.ext_badge.setText(ext.upper()[1:])
if ext in VIDEO_TYPES + AUDIO_TYPES:

View File

@@ -259,7 +259,11 @@ class ThumbRenderer(QObject):
artwork = Image.open(BytesIO(mp4_covers[0]))
if artwork:
image = artwork
except (mp4.MP4MetadataError, mp4.MP4StreamInfoError) as e:
except (
mp4.MP4MetadataError,
mp4.MP4StreamInfoError,
id3.ID3NoHeaderError,
) as e:
logging.error(
f"[ThumbRenderer]{ERROR}: Couldn't read album artwork for {_filepath.name} ({type(e).__name__})"
)