fix open image failure bug

pull/4/head
ERR0RPR0MPT 2024-04-16 11:05:56 +08:00
parent 94b5e5dab5
commit 527c2e0b01
1 changed files with 3 additions and 3 deletions

View File

@ -277,9 +277,6 @@ def getevent():
# print("单次执行时间:", (time.perf_counter() - start_time) * 1e3, "毫秒") # 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__": if __name__ == "__main__":
os.environ["PYGAME_HIDE_SUPPORT_PROMPT"] = "1" os.environ["PYGAME_HIDE_SUPPORT_PROMPT"] = "1"
import pygame import pygame
@ -304,6 +301,9 @@ if __name__ == "__main__":
else: else:
print("未找到配置文件, 使用默认配置") 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 '') + "开启屏幕反转") print(('' if REVERSE_MONITOR else '') + "开启屏幕反转")
serial_manager = SerialManager() serial_manager = SerialManager()
serial_manager.start() serial_manager.start()