aboutsummaryrefslogtreecommitdiff
path: root/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'util.py')
-rw-r--r--util.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/util.py b/util.py
index fba40fe..d6ac035 100644
--- a/util.py
+++ b/util.py
@@ -8,6 +8,7 @@ import collections
import urllib.parse
import multiprocessing
import pathlib
+import base64
from configparser import ConfigParser
import requests
@@ -79,6 +80,10 @@ def sanitize_text(text):
sanitized += replacement_map[char]
return sanitized
+def generate_base64_icon(filename):
+ with open(filename, "rb") as f:
+ return "data:image/png;base64," + base64.b64encode(f.read()).decode("utf8")
+
def read_file(fil):
"""