diff --git a/ks_includes/files.py b/ks_includes/files.py index 57813ca1..6bd39d1a 100644 --- a/ks_includes/files.py +++ b/ks_includes/files.py @@ -150,8 +150,11 @@ class KlippyFiles(): return True return False - def get_thumbnail_location(self, filename): + def get_thumbnail_location(self, filename, small=False): thumb = self.files[filename]['thumbnails'][0] + if small and len(self.files[filename]['thumbnails']) > 1: + if self.files[filename]['thumbnails'][0]['width'] > self.files[filename]['thumbnails'][1]['width']: + thumb = self.files[filename]['thumbnails'][1] if thumb['local'] is False: return ['http', thumb['path']] return ['file', thumb['path']] diff --git a/ks_includes/screen_panel.py b/ks_includes/screen_panel.py index 9193657a..079b86e4 100644 --- a/ks_includes/screen_panel.py +++ b/ks_includes/screen_panel.py @@ -57,11 +57,11 @@ class ScreenPanel: def get_content(self): return self.content - def get_file_image(self, filename, width=1.6, height=1.6): + def get_file_image(self, filename, width=1, height=1, small=False): if not self._files.has_thumbnail(filename): return None - loc = self._files.get_thumbnail_location(filename) + loc = self._files.get_thumbnail_location(filename, small) if loc is None: return None if loc[0] == "file": diff --git a/panels/print.py b/panels/print.py index f66c63be..a9d061da 100644 --- a/panels/print.py +++ b/panels/print.py @@ -212,7 +212,7 @@ class PrintPanel(ScreenPanel): file.set_vexpand(False) icon = Gtk.Image() - pixbuf = self.get_file_image(filepath) + pixbuf = self.get_file_image(filepath, small=True) if pixbuf is not None: icon.set_from_pixbuf(pixbuf) else: