Skip to content

Commit

Permalink
Fix crash when using covergrid + default art size (#4151)
Browse files Browse the repository at this point in the history
The default config value for browsers.cover_size is -1. The new
covergrid code works fine when the config file is absent, but with
this default it will crash after requesting a negative size from
`GdkPixbuf.Pixbuf.new_from_file_at_size`.
  • Loading branch information
afontenot committed Oct 1, 2022
1 parent 99cf4db commit a22b9f0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion quodlibet/browsers/covergrid/main.py
Expand Up @@ -157,7 +157,10 @@ def do_focus(self, direction):

def _get_cover_size():
mag = config.getfloat("browsers", "covergrid_magnification", 3.)
return mag * config.getint("browsers", "cover_size", 48)
size = config.getint("browsers", "cover_size")
if size <= 0:
size = 48
return mag * size


class CoverGrid(Browser, util.InstanceTracker, DisplayPatternMixin):
Expand Down

0 comments on commit a22b9f0

Please sign in to comment.