mirror of
https://github.com/fishyboteso/fishyboteso.git
synced 2024-08-30 18:32:13 +00:00
#156 scaling down full window screenshot
This commit is contained in:
parent
0c3b5da26b
commit
cc61caf12d
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user