diff --git a/hcatitles.py b/hcatitles.py index 9b86855..73852b9 100644 --- a/hcatitles.py +++ b/hcatitles.py @@ -1,8 +1,16 @@ +import os import PySimpleGUI as sg from PIL import Image, ImageDraw, ImageEnhance, ImageFilter, ImageFont, ImageOps from io import BytesIO -# Globals + +def resource_path(relative_path): + """ Get absolute path to resource, works for dev and for PyInstaller """ + try: + base_path = sys._MEIPASS + except Exception: + base_path = os.path.abspath(".") + return os.path.join(base_path, relative_path) def update_image(original, title, subtitle):