set palette mode for BGRA;15

Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
Yay295 2024-04-11 07:56:29 -05:00 committed by Yay295
parent 872ff125fc
commit e5c6d883d4

View File

@ -120,6 +120,7 @@ class TgaImageFile(ImageFile.ImageFile):
self.palette = ImagePalette.raw( self.palette = ImagePalette.raw(
"BGRA;15", b"\0" * 2 * start + self.fp.read(2 * size) "BGRA;15", b"\0" * 2 * start + self.fp.read(2 * size)
) )
self.palette.mode = "RGBA"
elif mapdepth == 24: elif mapdepth == 24:
self.palette = ImagePalette.raw( self.palette = ImagePalette.raw(
"BGR", b"\0" * 3 * start + self.fp.read(3 * size) "BGR", b"\0" * 3 * start + self.fp.read(3 * size)