aboutsummaryrefslogtreecommitdiff
path: root/logout-manager-tcl.py
diff options
context:
space:
mode:
Diffstat (limited to 'logout-manager-tcl.py')
-rwxr-xr-xlogout-manager-tcl.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/logout-manager-tcl.py b/logout-manager-tcl.py
index 4d823d5..cc3b2fb 100755
--- a/logout-manager-tcl.py
+++ b/logout-manager-tcl.py
@@ -39,7 +39,7 @@ import lmlib
LM_USE_SVG = 0
try:
- from cairosvgf import svg2png
+ from cairosvg import svg2png
LM_USE_SVG = 1
except:
print("WARNING: Unable to import cairosvg. No svg images will be displayed.")
@@ -274,6 +274,10 @@ def photoimage_from_svg(filename = "",size = "48"):
item = svg2png(url=filename, parent_width = size, parent_height = size)
return ImageTk.PhotoImage(data=item)
+def empty_photoimage(size=24):
+ photo = Image.new("RGBA",[size,size])
+ return ImageTk.PhotoImage(image=photo)
+
def image_from_svg(filename = "",size = "48"):
# open svg
if LM_USE_SVG == 1:
@@ -311,7 +315,7 @@ def get_scaled_icon(icon_name, size = 24, icon_theme = "default", fallback_icon_
except Exception as f:
print("Error with icon file.")
print(f)
- return None
+ return empty_photoimage()
photo.thumbnail(size=[size, size])
try:
photo = ImageTk.PhotoImage(photo)
bgstack15