convert to RGBA if not RBGA
This commit is contained in:
parent
fae9e5bd2b
commit
35b740496d
@ -354,6 +354,10 @@ class ImageData(BaseLayoutElement):
|
|||||||
logger.debug(f"ImageData: Creating texture for {self.image_path} (GL version: {gl_version})")
|
logger.debug(f"ImageData: Creating texture for {self.image_path} (GL version: {gl_version})")
|
||||||
pil_image = self._pending_pil_image
|
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
|
# Delete old texture if it exists
|
||||||
if hasattr(self, '_texture_id') and self._texture_id:
|
if hasattr(self, '_texture_id') and self._texture_id:
|
||||||
glDeleteTextures([self._texture_id])
|
glDeleteTextures([self._texture_id])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user