From 527c2e0b0140a9eb27c3f8bc625c4d56ebbc59eb Mon Sep 17 00:00:00 2001 From: ERR0RPR0MPT Date: Tue, 16 Apr 2024 11:05:56 +0800 Subject: [PATCH] fix open image failure bug --- main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index c7bf225..67537a1 100644 --- a/main.py +++ b/main.py @@ -277,9 +277,6 @@ def getevent(): # print("单次执行时间:", (time.perf_counter() - start_time) * 1e3, "毫秒") -exp_image = Image.open(IMAGE_PATH) -exp_image_width, exp_image_height = exp_image.size - if __name__ == "__main__": os.environ["PYGAME_HIDE_SUPPORT_PROMPT"] = "1" import pygame @@ -304,6 +301,9 @@ if __name__ == "__main__": else: print("未找到配置文件, 使用默认配置") + exp_image = Image.open(IMAGE_PATH) + exp_image_width, exp_image_height = exp_image.size + print(f"定位图路径: {IMAGE_PATH}") print(('已' if REVERSE_MONITOR else '未') + "开启屏幕反转") serial_manager = SerialManager() serial_manager.start()