diff --git a/data/weather.py b/data/weather.py index 50e228f1..e6dd6476 100644 --- a/data/weather.py +++ b/data/weather.py @@ -1,4 +1,4 @@ -import time +import os, time import pyowm @@ -102,7 +102,7 @@ def wind_string(self): return "{} {}".format(self.wind_speed_string(), self.wind_dir_string()) def icon_filename(self): - return "assets/weather/{}.png".format(self.icon_name) + return os.path.abspath("./assets/weather/{}.png".format(self.icon_name)) def __should_update(self): endtime = time.time() diff --git a/main.py b/main.py index d0e9b99e..aed14378 100755 --- a/main.py +++ b/main.py @@ -70,12 +70,12 @@ def main(matrix, config_base): debug.log("Using rgbmatrix version %s", __version__) # Draw startup screen - logo = "assets/mlb-w" + str(matrix.width) + "h" + str(matrix.height) + ".png" + logo_path = os.path.abspath("./assets/mlb-w" + str(matrix.width) + "h" + str(matrix.height) + ".png") # MLB image disabled when using renderer, for now. # see: https://github.com/ty-porter/RGBMatrixEmulator/issues/9#issuecomment-922869679 - if os.path.exists(logo) and driver.is_hardware() and PIL_LOADED: - logo = Image.open(logo) + if os.path.exists(logo_path) and driver.is_hardware() and PIL_LOADED: + logo = Image.open(logo_path) matrix.SetImage(logo.convert("RGB")) logo.close() diff --git a/renderers/offday.py b/renderers/offday.py index 2bafab9a..94a4a042 100644 --- a/renderers/offday.py +++ b/renderers/offday.py @@ -70,7 +70,7 @@ def __render_weather_icon(canvas, layout, colors, weather_icon): if resize: weather_icon = weather_icon.resize( - (weather_icon.width * resize, weather_icon.height * resize), PIL.Image.NEAREST + (weather_icon.width * resize, weather_icon.height * resize), Image.NEAREST ) for x in range(weather_icon.width): for y in range(weather_icon.height):