Files
photostation/memoire.md
Jules b39308af95 Photo strips, photo d'identité, NFC tap-to-upload
- Photo strips : 2 templates (3 ou 4 photos), toujours 2 strips côte à côte sur un 10x15
- Photo d'identité : écran dédié, cadrage 35x45mm guidé (ovale + ligne yeux), planche 8 photos sur 10x15
- NFC : service nfcpy optionnel, écrit URL upload sur tag NDEF, configurable dans admin
- Config : option NFC on/off ajoutée
- Matériel cible : mini-PC (plus RPi), imprimante DNP DS-RX1HS

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 20:15:03 +01:00

139 lines
6.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Photostation
## Description
Borne d'impression photo tactile. Les utilisateurs importent leurs photos (USB, WiFi, QR code, email, NFC), les éditent (recadrage, rotation, effets, goodies, multi-pose, photo strips, photo ID, texte) et les impriment sur imprimante sublimation.
## Concept
Ce n'est PAS un photobooth (pas de capture photo). C'est une station de transfert/impression : les utilisateurs arrivent avec leurs propres photos et la borne permet de les éditer et imprimer.
## Stack technique
- **Interface** : PyQt6 / QGraphicsScene (natif, léger, tactile)
- **Traitement image** : Pillow (effets, redimensionnement, export)
- **Impression** : CUPS via pycups
- **Serveur upload** : Flask (thread daemon, page upload mobile-friendly)
- **Email** : IMAP polling (thread daemon)
- **QR** : qrcode (Python)
- **NFC** : nfcpy (optionnel, nécessite lecteur USB type ACR122U)
## Matériel
- **Prototype** : Raspberry Pi 3B+ (1GB RAM) — en stock chez Jules, pour tests initiaux
- **Cible production** : Mini-PC (Intel N95/N100, 8GB RAM, 128GB SSD) — ~100-150€
- **Écran tactile** : en stock, 10-15" visé (interface responsive)
- **Imprimante sublimation** : DNP DS-RX1HS (~500-600€, consommable ~0.13€/tirage 10x15, 700 tirages/rouleau, driver CUPS Linux)
- **NFC** (optionnel) : lecteur USB ACR122U (~25-30€) pour tap-to-upload
- **Pas de capture photo** — les utilisateurs apportent leurs propres photos
## Architecture
```
src/
main.py — Point d'entrée (--kiosk pour plein écran)
services/
usb_watcher.py — Détection USB par polling
upload_server.py — Serveur Flask d'upload (WiFi + QR)
imap_watcher.py — Polling IMAP pour réception email
nfc_service.py — NFC tap-to-upload (nfcpy, optionnel)
ui/
style.py — Styles responsive (tailles en % de la fenêtre)
main_window.py — Navigation QStackedWidget (5 écrans)
screens/
home_screen.py — Accueil, 4 modes, config admin (appui long 5s)
import_screen.py — Galerie photos (cartes, quantités, pastille ratio)
editor_screen.py — Éditeur (crop, rotation, filtres, goodies, multi-pose, strips, photo ID, texte)
print_screen.py — Choix format, recadrage ratio, impression
id_photo_screen.py — Photo d'identité (cadrage 35x45mm, planche 8 photos)
widgets/
crop_overlay.py — Rectangle de crop ratio verrouillé, bord à bord
goodies_panel.py — Panneau stickers/cadres
multipose_dialog.py — Templates multi-pose + photo strips
config_dialog.py — Config admin complète
```
## Fonctionnalités implémentées (2026-03-22)
### Modes d'import
- **USB** : polling montages, scan récursif, bouton vert + compteur
- **QR Code** : mini QR sur le bouton, serveur Flask upload, bouton vert quand photos reçues → galerie directe
- **WiFi** : même serveur Flask, affiche nom AP + mot de passe
- **Email** : IMAP polling configurable, affiche adresse mail
- **NFC** : tap-to-upload via lecteur USB (optionnel, configurable)
### Galerie
- Cartes à taille fixe, miniatures centrées (QPushButton + icon)
- Clic sur la photo → ouvre l'éditeur avec cadre de recadrage auto si ratio ≠ 3:2
- Boutons − / quantité / + centrés sous chaque photo
- Pastille orange (point) si ratio ≠ 3:2
- Résumé "X photos — Y impressions"
- Bouton Valider → écran impression
### Éditeur
- Recadrage ratio verrouillé 3:2 (auto si ratio ≠ 3:2), bord à bord
- Rotation 90°, filtres (N&B, sépia, vintage, contraste)
- Multi-pose (5 templates, même photo dupliquée, crop to fill)
- **Photo Strips** (4 templates : strip 3/4 photos, 2 strips 3/4 photos sur 10x15)
- **Photo d'identité** (bouton Photo ID → écran dédié)
- Goodies (stickers draggable, cadres overlay)
- Texte éditable draggable
- Export scène → PNG haute résolution
### Photo d'identité
- Écran dédié avec cadrage guidé au ratio 35x45mm
- Repères visuels : ovale tête, ligne des yeux
- Génération planche 8 photos (4x2) sur format 10x15
- Traits de coupe entre les photos
- Prévisualisation avant impression
- Option future : e-photo ANTS via API ephoto.io
### Impression
- Formats activables par format dans la config (10x15, 13x18, 15x20)
- Imprimante CUPS assignable par format
- Cadre de recadrage au ratio du format, bord à bord, déplaçable
### Config admin (appui long 5s sur "Photostation")
- WiFi : nom AP, mot de passe
- Serveur upload : IP d'écoute, port, URL publique (QR code)
- Email IMAP : activer/désactiver, serveur, port, user, password, dossier, intervalle
- NFC : activer/désactiver
- Formats d'impression : checkbox par format + imprimante CUPS
- Sauvegardé dans config/settings.json
### Interface
- Responsive : toutes tailles en % de la fenêtre
- Fonctionne en 800x480, 1024x768, 1280x1024, 1920x1080
- Mode kiosk sans WM (FramelessWindowHint + setGeometry)
- Guard anti-boucle de zoom dans resizeEvent
## Dev
- **Repo Gitea** : https://git.copydev.fr/jules/photostation
- **Token Gitea** : `4bc923c47cf363a866daa1e1a6cf22bc44a78bc5` (claude-photostation)
- **LXC dev** : ID 164, hostname `photostation`, IP `192.168.111.164`
- Debian 12, 2GB RAM, 2 cores
- Python 3 + PyQt6 6.10.2 + Pillow 12.1.1 + Flask 3.1.3 + venv `/opt/photostation/venv/`
- Code dans `/opt/photostation/`
- Xvfb :99 (1280x1024) + VNC port 5900 (sans mot de passe)
- 50 photos test dans `/media/usb_test/` (bind mount simulé)
- Scripts test : `test_gallery.py`, `test_editor.py`, `test_multipose.py`, `test_print.py`
- **NPM** : `photo.copydev.fr` → `192.168.111.164:8080` (proxy id=58, cert wildcard *.copydev.fr)
- **Git config** : user `Jules`, email `contact@copydev.fr`
## TODO
- [ ] e-photo ANTS : intégrer API ephoto.io (crédits à acheter, API REST, génère code 22 caractères)
- [ ] Hotspot WiFi captif (hostapd + dnsmasq)
- [ ] Peupler assets/goodies/ et assets/frames/
- [ ] Tests sur RPi 3B+ (prototype)
- [ ] Tests sur mini-PC cible
- [ ] Acheter DNP DS-RX1HS + premier kit consommable
## e-photo ANTS (future)
- **API** : ephoto.io — API REST agréée ANTS depuis 2020
- **Principe** : crédits prépayés (1 crédit = 1 code e-photo), pas d'abonnement
- **Intégration** : envoyer la photo ID via API, récupérer le code 22 caractères, imprimer sur la planche
- **Alternative** : EasyEPhoto (MB Tech) — accès navigateur, ~0.36€/photo (pack 1000)
- **Pas d'API ANTS publique** — il faut passer par un prestataire agréé
## Formats d'impression
| Format | Ratio | Dimensions cm |
|--------|-------|---------------|
| 10x15 | 1.5 (3:2) | 10 × 15 |
| 13x18 | 1.385 | 13 × 18 |
| 15x20 | 1.333 (4:3) | 15 × 20 |