[gimp] file-bmp: Rewrite code



commit 4978f370fe230e1be2775ea0481f699276e646f9
Author: Mukund Sivaraman <muks banu com>
Date:   Sun May 8 21:22:31 2011 +0530

    file-bmp: Rewrite code

 plug-ins/file-bmp/bmp-write.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/plug-ins/file-bmp/bmp-write.c b/plug-ins/file-bmp/bmp-write.c
index 17ae8b7..63d0f0c 100644
--- a/plug-ins/file-bmp/bmp-write.c
+++ b/plug-ins/file-bmp/bmp-write.c
@@ -195,8 +195,12 @@ WriteBMP (const gchar  *filename,
       colors       = 256;
       BitsPerPixel = 8;
       MapSize      = 1024;
-      if (drawable_type == GIMP_GRAY_IMAGE) channels = 1;
-      else channels = 2;
+
+      if (drawable_type == GIMP_GRAYA_IMAGE)
+        channels = 2;
+      else
+        channels = 1;
+
       for (i = 0; i < colors; i++)
         {
           Red[i]   = i;
@@ -216,8 +220,11 @@ WriteBMP (const gchar  *filename,
     case GIMP_INDEXED_IMAGE:
       cmap     = gimp_image_get_colormap (image, &colors);
       MapSize  = 4 * colors;
-      if (drawable_type == GIMP_INDEXED_IMAGE) channels = 1;
-      else channels = 2;
+
+      if (drawable_type == GIMP_INDEXEDA_IMAGE)
+        channels = 2;
+      else
+        channels = 1;
 
       if (colors > 16)
         BitsPerPixel = 8;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]