convert to RGBA if not RBGA
Some checks failed
Python CI / test (push) Successful in 1m16s
Lint / lint (push) Successful in 1m31s
Tests / test (3.10) (push) Successful in 1m9s
Tests / test (3.11) (push) Successful in 1m9s
Tests / test (3.9) (push) Has been cancelled

This commit is contained in:
Duncan Tourolle 2025-11-27 22:02:44 +01:00
parent fae9e5bd2b
commit 35b740496d

View File

@ -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])