Skip to content

Commit

Permalink
修复macos下ADB截图失效的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
lisai9093 committed Jan 11, 2024
1 parent 82481e9 commit bbabf28
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions action.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ def screenshot(monitor):
if sys.platform=='win32':
#only for Windows, otherwise it will be None
image_bytes = image_bytes.replace(b'\r\n', b'\n')
image_bytes = numpy.fromstring(image_bytes, numpy.uint8)
screen = cv2.imdecode(numpy.fromstring(image_bytes, numpy.uint8),cv2.IMREAD_COLOR)
screen = cv2.imdecode(numpy.frombuffer(image_bytes, numpy.uint8),cv2.IMREAD_COLOR)
#print('screen: ',screen)
#print('screen size: ',screen.shape[1],screen.shape[0])
return screen
Expand Down

0 comments on commit bbabf28

Please sign in to comment.