Skip to content

Commit

Permalink
Show placeholder if cover image format is unsupported
Browse files Browse the repository at this point in the history
  • Loading branch information
phw committed Oct 10, 2023
1 parent 11c1d1b commit 45c38d4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions picard/ui/coverartbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,10 @@ def set_data(self, data, force=False, has_common_images=True):
if len(self.data) == 1:
pixmap = QtGui.QPixmap()
try:
pixmap.loadFromData(self.data[0].data)
pixmap = self.decorate_cover(pixmap)
if pixmap.loadFromData(self.data[0].data):
pixmap = self.decorate_cover(pixmap)
else:
pixmap = self.file_missing_pixmap
except CoverArtImageIOError:
pixmap = self.file_missing_pixmap
else:
Expand Down Expand Up @@ -280,7 +282,8 @@ def calculate_cover_coordinates(pixmap, cx, cy):
else:
thumb = QtGui.QPixmap()
try:
thumb.loadFromData(image.data)
if not thumb.loadFromData(image.data):
thumb = self.file_missing_pixmap
except CoverArtImageIOError:
thumb = self.file_missing_pixmap
thumb = self.decorate_cover(thumb)
Expand Down

0 comments on commit 45c38d4

Please sign in to comment.