From 35b740496d83effad97f3b45393d5f9d07954101 Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Thu, 27 Nov 2025 22:02:44 +0100 Subject: [PATCH] convert to RGBA if not RBGA --- pyPhotoAlbum/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyPhotoAlbum/models.py b/pyPhotoAlbum/models.py index 13450b4..b5acf21 100644 --- a/pyPhotoAlbum/models.py +++ b/pyPhotoAlbum/models.py @@ -354,6 +354,10 @@ class ImageData(BaseLayoutElement): logger.debug(f"ImageData: Creating texture for {self.image_path} (GL version: {gl_version})") pil_image = self._pending_pil_image + # Ensure RGBA format for GL_RGBA texture (defensive check) + if pil_image.mode != 'RGBA': + pil_image = pil_image.convert('RGBA') + # Delete old texture if it exists if hasattr(self, '_texture_id') and self._texture_id: glDeleteTextures([self._texture_id])