diff options
author | B Stack <bgstack15@gmail.com> | 2019-06-20 11:30:01 -0400 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2019-06-20 11:30:01 -0400 |
commit | d8a46b01f3df7366d2323be0e954d2af090870fd (patch) | |
tree | 73b22584c7b2cb2fc7bb733bb3d08efd144b58a1 | |
parent | WIP: add initial svg support (diff) | |
download | logout-manager-d8a46b01f3df7366d2323be0e954d2af090870fd.tar.gz logout-manager-d8a46b01f3df7366d2323be0e954d2af090870fd.tar.bz2 logout-manager-d8a46b01f3df7366d2323be0e954d2af090870fd.zip |
WIP: rearrange the photoimage error check
-rwxr-xr-x | logout-manager-tcl.py | 8 |
1 files 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: |