From 34e144e1eb20a00032e6bb091a24e87ef0d78218 Mon Sep 17 00:00:00 2001 From: William Skaggs Date: Fri, 19 May 2006 16:10:07 +0000 Subject: [PATCH] Bill Skaggs * plug-ins/common/tga.c: gracefully handle incorrect alpha info in header; fixes bug #306675. --- ChangeLog | 5 +++++ plug-ins/common/tga.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1e7e742da3..38fad5f408 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-05-19 Bill Skaggs + + * plug-ins/common/tga.c: gracefully handle incorrect alpha + info in header; fixes bug #306675. + 2006-05-19 Michael Natterer * app/core/gimpitem-linked.h: remove enum GimpItemLinkedMask... diff --git a/plug-ins/common/tga.c b/plug-ins/common/tga.c index 40903df749..d9fca706ce 100644 --- a/plug-ins/common/tga.c +++ b/plug-ins/common/tga.c @@ -505,6 +505,10 @@ load_image (const gchar *filename) info.flipHoriz = (header[17] & 0x10) ? 1 : 0; info.flipVert = (header[17] & 0x20) ? 0 : 1; + /* hack to handle some existing files with incorrect headers, see bug #306675 */ + if (info.alphaBits == info.bpp) + info.alphaBits = 0; + switch (info.imageType) { case TGA_TYPE_MAPPED: