From cc61caf12dcefb172207e442c2253a1609eebf1d Mon Sep 17 00:00:00 2001 From: Adam Saudagar Date: Thu, 9 Mar 2023 15:38:50 +0530 Subject: [PATCH] #156 scaling down full window screenshot --- fishy/engine/common/window.py | 2 +- fishy/helper/helper.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/fishy/engine/common/window.py b/fishy/engine/common/window.py index 213d1e9..e644825 100644 --- a/fishy/engine/common/window.py +++ b/fishy/engine/common/window.py @@ -101,4 +101,4 @@ class WindowClient: if WindowServer.status == Status.CRASHED: return - helper.save_img(self.show_name, img) + helper.save_img(self.show_name, img, True) diff --git a/fishy/helper/helper.py b/fishy/helper/helper.py index 64d8c02..b1813c6 100644 --- a/fishy/helper/helper.py +++ b/fishy/helper/helper.py @@ -209,12 +209,15 @@ def print_exc(): traceback.print_exc() -def save_img(show_name, img): +def save_img(show_name, img, half=False): img_path = os.path.join(os_services.get_documents_path(), "fishy_debug", "imgs", show_name) if not os.path.exists(img_path): os.makedirs(img_path) + if half: + img = cv2.resize(img, (0, 0), fx=0.5, fy=0.5) + t = time.strftime("%Y.%m.%d.%H.%M.%S") cv2.imwrite( - os.path.join(img_path, f"{t}.png"), + os.path.join(img_path, f"{t}.jpg"), img)