Skip to content

Commit

Permalink
Fix 4 Winwin
Browse files Browse the repository at this point in the history
  • Loading branch information
Gakamine authored Feb 16, 2023
1 parent 49ab885 commit a57bf07
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/screenshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ def take_screenshot():
cv2.imwrite("screenshot.jpg", image)
image=Image.open("screenshot.jpg")
image.save("screenshot.jpg", quality=30)
image.close()
image=open("screenshot.jpg","rb")
encoded_image = base64.b64encode(image.read()).decode()
image.close()
md5=hashlib.md5(encoded_image.encode("utf-8")).hexdigest()
os.remove("screenshot.jpg")
return (md5,encoded_image)
return (md5,encoded_image)

0 comments on commit a57bf07

Please sign in to comment.