fix: import io manquant dans template matching
Some checks failed
security-audit / Bandit (scan statique) (push) Successful in 12s
security-audit / pip-audit (CVE dépendances) (push) Successful in 11s
security-audit / Scan secrets (grep) (push) Successful in 7s
tests / Lint (ruff + black) (push) Successful in 13s
tests / Tests unitaires (sans GPU) (push) Failing after 14s
tests / Tests sécurité (critique) (push) Has been skipped

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dom
2026-04-21 19:21:15 +02:00
parent de1026ee2e
commit 552e66dbf6

View File

@@ -849,6 +849,7 @@ def execute_action(action_type: str, params: dict) -> dict:
try: try:
import cv2 import cv2
import numpy as np import numpy as np
import io as _io
import mss as mss_lib import mss as mss_lib
from PIL import Image as PILImage from PIL import Image as PILImage
@@ -859,7 +860,7 @@ def execute_action(action_type: str, params: dict) -> dict:
# Décoder l'ancre # Décoder l'ancre
anchor_data = base64.b64decode(screenshot_base64.split(',')[1] if ',' in screenshot_base64 else screenshot_base64) anchor_data = base64.b64decode(screenshot_base64.split(',')[1] if ',' in screenshot_base64 else screenshot_base64)
anchor_img = PILImage.open(io.BytesIO(anchor_data)) anchor_img = PILImage.open(_io.BytesIO(anchor_data))
screen_cv = cv2.cvtColor(np.array(screen_img), cv2.COLOR_RGB2BGR) screen_cv = cv2.cvtColor(np.array(screen_img), cv2.COLOR_RGB2BGR)
anchor_cv = cv2.cvtColor(np.array(anchor_img), cv2.COLOR_RGB2BGR) anchor_cv = cv2.cvtColor(np.array(anchor_img), cv2.COLOR_RGB2BGR)