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:
48
frontend/js/effects.js
vendored
48
frontend/js/effects.js
vendored
@@ -23,11 +23,18 @@ async function appliquerFiltreUI(filtre, btn) {
|
||||
btn.classList.add('actif');
|
||||
filtreActuel = filtre;
|
||||
|
||||
if (modeActuel === 'multi') {
|
||||
// En mode multi : ré-assembler le strip avec le filtre appliqué sur chaque photo
|
||||
await appliquerFiltreStrip(filtre);
|
||||
return;
|
||||
}
|
||||
|
||||
if (filtre === 'original') {
|
||||
const chemin = '/data/photos/' + photosSession[0];
|
||||
document.getElementById('photo-resultat').src = chemin;
|
||||
document.getElementById('photo-partage').src = chemin;
|
||||
photoFinale = photosSession[0];
|
||||
afficherCadreOverlay(cadreChoisi);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -40,9 +47,50 @@ async function appliquerFiltreUI(filtre, btn) {
|
||||
photoFinale = resultat.nom;
|
||||
document.getElementById('photo-resultat').src = '/data/exports/' + resultat.nom;
|
||||
document.getElementById('photo-partage').src = '/data/exports/' + resultat.nom;
|
||||
afficherCadreOverlay(cadreChoisi);
|
||||
}
|
||||
}
|
||||
|
||||
async function appliquerFiltreStrip(filtre) {
|
||||
let photosAAssembler = photosSession;
|
||||
let source = 'photos'; // les originaux sont dans data/photos/
|
||||
|
||||
if (filtre !== 'original') {
|
||||
const promises = photosSession.map(p => apiPost('/api/filtre', { photo: p, filtre }));
|
||||
const resultats = await Promise.all(promises);
|
||||
photosAAssembler = resultats.filter(r => r.nom).map(r => r.nom);
|
||||
source = 'exports'; // les filtrés sont dans data/exports/
|
||||
if (photosAAssembler.length === 0) return;
|
||||
}
|
||||
|
||||
const mode = config.multi_shot?.mode || 'strip';
|
||||
const endpoint = mode === 'strip' ? '/api/strip' : '/api/collage';
|
||||
const resultat = await apiPost(endpoint, { photos: photosAAssembler, source });
|
||||
|
||||
if (resultat.nom) {
|
||||
photoFinale = resultat.nom;
|
||||
if (resultat.impression) photoImpression = resultat.impression;
|
||||
const src = '/data/exports/' + resultat.nom;
|
||||
document.getElementById('photo-resultat').src = src;
|
||||
document.getElementById('photo-partage').src = src;
|
||||
afficherCadreOverlay(cadreChoisi);
|
||||
}
|
||||
}
|
||||
|
||||
function afficherCadreOverlay(nom) {
|
||||
const el = document.getElementById('cadre-overlay-preview');
|
||||
if (!el) return;
|
||||
if (!nom) {
|
||||
el.classList.add('cache');
|
||||
el.src = '';
|
||||
return;
|
||||
}
|
||||
const config_imp = config.impression || {};
|
||||
const fmt = (config_imp.format || '15x20').replace('-2up', '');
|
||||
el.src = `/assets/cadres/${fmt}/${nom}`;
|
||||
el.classList.remove('cache');
|
||||
}
|
||||
|
||||
async function chargerOverlays() {
|
||||
const overlays = await apiGet('/api/overlays');
|
||||
const barre = document.getElementById('barre-overlays');
|
||||
|
||||
Reference in New Issue
Block a user