Fix freeze liveview : bloquer surveiller_dslr pendant preview (conflit gphoto2)

This commit is contained in:
2026-04-09 01:38:59 +02:00
parent 94e3d68dd7
commit a59f0ef766
2 changed files with 4 additions and 2 deletions

View File

@@ -3,6 +3,8 @@ import logging
import subprocess import subprocess
import time import time
from datetime import datetime from datetime import datetime
import numpy as np
from pathlib import Path from pathlib import Path
import cv2 import cv2
@@ -203,7 +205,7 @@ class Camera:
donnees = bytes(fichier.get_data_and_size()) donnees = bytes(fichier.get_data_and_size())
# Redimensionner pour alléger le WebSocket # Redimensionner pour alléger le WebSocket
img = cv2.imdecode( img = cv2.imdecode(
__import__("numpy").frombuffer(donnees, dtype=__import__("numpy").uint8), np.frombuffer(donnees, dtype=np.uint8),
cv2.IMREAD_COLOR, cv2.IMREAD_COLOR,
) )
if img is not None: if img is not None:

View File

@@ -89,7 +89,7 @@ async def surveiller_dslr():
global _dslr_erreurs global _dslr_erreurs
while True: while True:
await asyncio.sleep(5) await asyncio.sleep(5)
if capture_en_cours: if capture_en_cours or _preview_actif:
continue continue
try: try:
if GPHOTO2_DISPONIBLE: if GPHOTO2_DISPONIBLE: