Impression Mitsubishi K60 + cadres + interface admin distante
- Intégration selphy_print (backend CUPS dyesub Mitsubishi CP-K60DW-S) - Formats impression : 15x20, 10x15, 10x15 2-strips avec cadre et orientation portrait/paysage - Cadres d'impression par format (strip/10x15/15x20) : upload, sélection, aperçu live - Cadres démo générés : pellicule noir/vintage/couleurs + bordures classique/doré/rose gold - Écran de choix de cadre avant capture (clic direct, aperçu grand format) - Filtres réduits à 3 (Couleur, N&B, Sépia) et appliqués sur tous les strips - Port 80 via authbind, route /admin avec redirection auto depuis poste distant - Autologin LightDM corrigé (pam-autologin-service) - Bouton évacuer bourrage papier dans admin - Fix : _gp_lock manquant dans Camera.__init__ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ from pathlib import Path
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
from backend.config import DOSSIER_EXPORTS, charger_config
|
||||
from backend.effects import appliquer_cadre_impression
|
||||
|
||||
log = logging.getLogger("photobooth.collage")
|
||||
|
||||
@@ -28,7 +29,8 @@ def _crop_center(img: Image.Image, ratio_cible: float) -> Image.Image:
|
||||
return img.crop((0, offset, img.width, offset + nouvelle_hauteur))
|
||||
|
||||
|
||||
def creer_strip(photos: list[Path], marge: int = 10, couleur_fond: str = "#000000") -> Path:
|
||||
def creer_strip(photos: list[Path], marge: int = 10, couleur_fond: str = "#000000",
|
||||
cadre: str | None = None) -> Path:
|
||||
"""Cree une bande portrait style pellicule (4 photos de gauche a droite).
|
||||
|
||||
Pellicule noire avec perforations, photos separees par des bandes noires.
|
||||
@@ -83,6 +85,9 @@ def creer_strip(photos: list[Path], marge: int = 10, couleur_fond: str = "#00000
|
||||
strip.paste(img, (x, perf_hauteur))
|
||||
x += largeur_cellule + sep
|
||||
|
||||
if cadre:
|
||||
strip = appliquer_cadre_impression(strip, "strip", cadre)
|
||||
|
||||
nom = f"strip_{photos[0].stem}.jpg"
|
||||
chemin = DOSSIER_EXPORTS / nom
|
||||
strip.save(chemin, "JPEG", quality=95, dpi=(300, 300))
|
||||
@@ -115,7 +120,7 @@ def creer_impression_strip(chemin_strip: Path, marge: int = 20,
|
||||
|
||||
|
||||
def creer_collage(photos: list[Path], colonnes: int = 2, marge: int = 25,
|
||||
couleur_fond: str = "#ffffff") -> Path:
|
||||
couleur_fond: str = "#ffffff", cadre: str | None = None) -> Path:
|
||||
"""Cree un collage en grille au format 10x15cm."""
|
||||
nb = len(photos)
|
||||
images = [Image.open(p) for p in photos]
|
||||
@@ -141,6 +146,9 @@ def creer_collage(photos: list[Path], colonnes: int = 2, marge: int = 25,
|
||||
y = marge + lig * (hauteur_cellule + marge)
|
||||
collage.paste(img, (x, y))
|
||||
|
||||
if cadre:
|
||||
collage = appliquer_cadre_impression(collage, "10x15", cadre)
|
||||
|
||||
nom = f"collage_{photos[0].stem}.jpg"
|
||||
chemin = DOSSIER_EXPORTS / nom
|
||||
collage.save(chemin, "JPEG", quality=95, dpi=(300, 300))
|
||||
|
||||
Reference in New Issue
Block a user