From d8a46b01f3df7366d2323be0e954d2af090870fd Mon Sep 17 00:00:00 2001 From: B Stack Date: Thu, 20 Jun 2019 11:30:01 -0400 Subject: WIP: rearrange the photoimage error check --- logout-manager-tcl.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/logout-manager-tcl.py b/logout-manager-tcl.py index f774088..9d8f999 100755 --- a/logout-manager-tcl.py +++ b/logout-manager-tcl.py @@ -298,14 +298,14 @@ def get_scaled_icon(icon_name, size = 24, icon_theme = "default", fallback_icon_ else: photo = Image.open(iconfilename) photo.thumbnail(size=[size, size]) + try: + photo = ImageTk.PhotoImage(photo) + except Exception as e: + print("Error was ",e) except: print("Error with icon file.") return None # If I ever add HiDPI support, multiple size here by the factor. So, size * 1.25 - try: - photo = ImageTk.PhotoImage(photo) - except Exception as e: - print("Error was ",e) return photo class App: -- cgit