From eababa9ec85e819d4fbb626fdcdda771cb6c8021 Mon Sep 17 00:00:00 2001 From: Jules Date: Wed, 8 Apr 2026 08:30:44 +0200 Subject: [PATCH] Photos DSLR: 4000px max, JPEG 92% (~1.5-2 Mo) Co-Authored-By: Claude Opus 4.6 (1M context) --- backend/camera.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/camera.py b/backend/camera.py index 92c55f7..e61f114 100644 --- a/backend/camera.py +++ b/backend/camera.py @@ -159,12 +159,12 @@ class Camera: tmp_path = str(chemin_dest) + ".tmp" fichier_camera.save(tmp_path) - # Redimensionner (max 2000px de large, JPEG 90%) + # Redimensionner (max 4000px de large, JPEG 92%) img = PILImage.open(tmp_path) - if img.width > 2000: - ratio = 2000 / img.width - img = img.resize((2000, int(img.height * ratio)), PILImage.LANCZOS) - img.save(str(chemin_dest), "JPEG", quality=90) + if img.width > 4000: + ratio = 4000 / img.width + img = img.resize((4000, int(img.height * ratio)), PILImage.LANCZOS) + img.save(str(chemin_dest), "JPEG", quality=92) Path(tmp_path).unlink(missing_ok=True) log.info(f"Photo capturee (DSLR) : {chemin_dest} ({img.width}x{img.height})")