summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorscuri <scuri>2010-08-13 14:19:48 +0000
committerscuri <scuri>2010-08-13 14:19:48 +0000
commit85b707fd418f93cadfa0c2bbf3776c41b5899ac1 (patch)
treeed3e47c25b8379da166c1fdfb7e2ea1ec9eca32c /src
parentd5ddef516e5dcdf71dec2d2f83f81c4341af9086 (diff)
Fixed: write support for alpha in TGA format. (Thanks to Nicolas Noble)
Diffstat (limited to 'src')
-rw-r--r--src/im_format_tga.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/im_format_tga.cpp b/src/im_format_tga.cpp
index 86e968a..9590c13 100644
--- a/src/im_format_tga.cpp
+++ b/src/im_format_tga.cpp
@@ -2,7 +2,7 @@
* \brief TGA - Truevision Graphics Adapter File
*
* See Copyright Notice in im_lib.h
- * $Id: im_format_tga.cpp,v 1.2 2008/12/03 15:45:34 scuri Exp $
+ * $Id: im_format_tga.cpp,v 1.3 2010/08/13 14:19:49 scuri Exp $
*/
#include "im_format.h"
@@ -475,7 +475,14 @@ int imFileFormatTGA::WriteImageInfo()
this->image_type = 1;
break;
case IM_RGB:
- this->bpp = 24;
+ if (imColorModeHasAlpha(this->user_color_mode))
+ {
+ this->bpp = 32;
+ this->file_color_mode |= IM_ALPHA;
+ }
+ else
+ this->bpp = 24;
+
this->file_color_mode |= IM_PACKED;
if (imStrEqual(this->compression, "RLE"))
this->image_type = 10;