From 2f96447919dfec55b93c01c8a45ac4123c0c6a66 Mon Sep 17 00:00:00 2001 From: Jules Date: Sat, 21 Mar 2026 23:49:50 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20crash=20galerie=20:=20r=C3=A9duire=20les?= =?UTF-8?q?=20pixmaps=20avant=20stockage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 50 photos 1920x1080 en mémoire = segfault sur 2GB RAM. Réduit à 400px de large pour les miniatures. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/ui/screens/import_screen.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ui/screens/import_screen.py b/src/ui/screens/import_screen.py index eb0cbf3..e589b5f 100644 --- a/src/ui/screens/import_screen.py +++ b/src/ui/screens/import_screen.py @@ -46,7 +46,12 @@ class PhotoCard(QFrame): """) self.thumb_btn.clicked.connect(self._edit) - self._pixmap_original = QPixmap(self.path) + # Charger une version réduite (pas l'originale en pleine résolution) + full = QPixmap(self.path) + if not full.isNull() and full.width() > 400: + self._pixmap_original = full.scaledToWidth(400, Qt.TransformationMode.SmoothTransformation) + else: + self._pixmap_original = full self._update_thumbnail() layout.addWidget(self.thumb_btn)