Photos DSLR: 4000px max, JPEG 92% (~1.5-2 Mo)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -159,12 +159,12 @@ class Camera:
|
|||||||
tmp_path = str(chemin_dest) + ".tmp"
|
tmp_path = str(chemin_dest) + ".tmp"
|
||||||
fichier_camera.save(tmp_path)
|
fichier_camera.save(tmp_path)
|
||||||
|
|
||||||
# Redimensionner (max 2000px de large, JPEG 90%)
|
# Redimensionner (max 4000px de large, JPEG 92%)
|
||||||
img = PILImage.open(tmp_path)
|
img = PILImage.open(tmp_path)
|
||||||
if img.width > 2000:
|
if img.width > 4000:
|
||||||
ratio = 2000 / img.width
|
ratio = 4000 / img.width
|
||||||
img = img.resize((2000, int(img.height * ratio)), PILImage.LANCZOS)
|
img = img.resize((4000, int(img.height * ratio)), PILImage.LANCZOS)
|
||||||
img.save(str(chemin_dest), "JPEG", quality=90)
|
img.save(str(chemin_dest), "JPEG", quality=92)
|
||||||
Path(tmp_path).unlink(missing_ok=True)
|
Path(tmp_path).unlink(missing_ok=True)
|
||||||
|
|
||||||
log.info(f"Photo capturee (DSLR) : {chemin_dest} ({img.width}x{img.height})")
|
log.info(f"Photo capturee (DSLR) : {chemin_dest} ({img.width}x{img.height})")
|
||||||
|
|||||||
Reference in New Issue
Block a user