From 148a39b5913d631afe7b5be56230359595db1373 Mon Sep 17 00:00:00 2001 From: YoursFunny Date: Mon, 6 Jul 2026 18:55:15 +0800 Subject: [PATCH] fix: update image flipping to create a writable copy --- module/device/method/ascreencap.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/device/method/ascreencap.py b/module/device/method/ascreencap.py index f793ff4..82e4e8a 100644 --- a/module/device/method/ascreencap.py +++ b/module/device/method/ascreencap.py @@ -170,7 +170,9 @@ class AScreenCap(Connection): # ValueError: cannot reshape array of size 0 into shape (720,1280,4) raise ImageTruncated(str(e)) - cv2.flip(image, 0, dst=image) + # flip without `dst=image` + # np.frombuffer creates a read-only memory view, we need to create a writable copy here + image = cv2.flip(image, 0) if image is None: raise ImageTruncated('Empty image after cv2.flip')