plug-ins: fix #1111 TGA with indexed colors + alpha channel : not displayed correctly

Just like COLOR targa MAPPED (indexed) images with a size of 32 per
index should also have alphaBits set to 8 or else the images get
loaded incorrectly.
This commit is contained in:
Jacob Boerema 2021-10-15 11:43:34 -04:00
parent a637692533
commit a77131db3c
1 changed files with 3 additions and 0 deletions

View File

@ -547,6 +547,9 @@ load_image (GFile *file,
/* hack to handle yet another flavor of incorrect headers, see bug #540969 */
if (info.alphaBits == 0)
{
if (info.imageType == TGA_TYPE_MAPPED && info.colorMapSize == 32)
info.alphaBits = 8;
if (info.imageType == TGA_TYPE_COLOR && info.bpp == 32)
info.alphaBits = 8;