From 9bb91f9e5720f831a563ec402e062fd386e4ea2c Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Sat, 21 Dec 2002 09:52:03 +0000 Subject: [PATCH] Fix so that rgba targa files view correctly in gimp: Submitted to bf-committers by Chris Want Kent Index: targa.c =================================================================== RCS file: /cvs01/blender/source/blender/imbuf/intern/targa.c,v retrieving revision 1.4 diff -u -r1.4 targa.c --- targa.c 2002/12/20 01:29:14 1.4 +++ targa.c 2002/12/21 09:50:24 @@ -289,6 +289,12 @@ if (flags & IB_ttob) buf[17] ^= 0x20; + /* Don't forget to indicate that your 32 bit + * targa uses 8 bits for the alpha channel! */ + if (ibuf->depth==32) { + buf[17] |= 0x08; + } + if (write(file, buf, 18) != 18) return (0); if (ibuf->cmap){ for (i = 0 ; imaxcol ; i++){ --- source/blender/imbuf/intern/targa.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c index 68db04b52c1..311d85eace3 100644 --- a/source/blender/imbuf/intern/targa.c +++ b/source/blender/imbuf/intern/targa.c @@ -289,6 +289,12 @@ short imb_savetarga(struct ImBuf * ibuf, int file, int flags) if (flags & IB_ttob) buf[17] ^= 0x20; + /* Don't forget to indicate that your 32 bit + * targa uses 8 bits for the alpha channel! */ + if (ibuf->depth==32) { + buf[17] |= 0x08; + } + if (write(file, buf, 18) != 18) return (0); if (ibuf->cmap){ for (i = 0 ; imaxcol ; i++){