diff options
author | Kent Mein <mein@cs.umn.edu> | 2002-12-21 12:52:03 +0300 |
---|---|---|
committer | Kent Mein <mein@cs.umn.edu> | 2002-12-21 12:52:03 +0300 |
commit | 9bb91f9e5720f831a563ec402e062fd386e4ea2c (patch) | |
tree | 9b78be58f13b9948e14f024e1933f24a55479152 /source/blender/imbuf | |
parent | 0f95aa1622793eb3ed24bb4be894bc28f8bb8b25 (diff) |
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 ; i<ibuf->maxcol ; i++){
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/intern/targa.c | 6 |
1 files changed, 6 insertions, 0 deletions
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 ; i<ibuf->maxcol ; i++){ |