DSLR auto-recovery USB reset + cadre overlay non-mirroré + lien galerie événement

- surveiller_dslr: reset USB ioctl après 2 échecs, double reset après 3
- deconnecter(): timeout threading 3s pour éviter blocage PTP
- CSS: .preview-live .cadre-overlay sans scaleX(-1)
- Admin événement: lien direct vers galerie en ligne

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-23 08:30:15 +02:00
parent 6bbcf85e52
commit 97e3f6508d
5 changed files with 75 additions and 32 deletions

View File

@@ -114,13 +114,19 @@ class Camera:
log.error(f"Impossible d'ouvrir /dev/video{index}")
return False
def deconnecter(self):
"""Deconnecte l'appareil photo."""
def deconnecter(self, timeout: float = 3.0):
"""Deconnecte l'appareil photo avec timeout pour eviter le blocage PTP."""
if self.camera and GPHOTO2_DISPONIBLE:
try:
self.camera.exit()
except gp.GPhoto2Error:
pass
def _exit():
try:
self.camera.exit()
except Exception:
pass
t = threading.Thread(target=_exit, daemon=True)
t.start()
t.join(timeout=timeout)
if t.is_alive():
log.warning("camera.exit() bloque — abandon (le FD sera libere au GC)")
if self.webcam:
self.webcam.release()
self.camera = None