[gimp] Bug 784462 - Export in C source format reports wrong BPP/buffer-size ...



commit cd3ca47cc138a03b2a4e9678fd8f7a7eed8e654d
Author: Ell <ell_se yahoo com>
Date:   Fri Jul 7 03:45:20 2017 -0400

    Bug 784462 - Export in C source format reports wrong BPP/buffer-size ...
    
    ... when using macros + RGB565

 plug-ins/common/file-csource.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/plug-ins/common/file-csource.c b/plug-ins/common/file-csource.c
index 24724e2..9e31a99 100644
--- a/plug-ins/common/file-csource.c
+++ b/plug-ins/common/file-csource.c
@@ -634,7 +634,7 @@ save_image (GFile   *file,
                        "%u * %u * %u + 1];\n",
                        width,
                        height,
-                       config->rgb565 ? 2 : (config->alpha ? 4 : 3)))
+                       bpp))
             goto fail;
         }
 
@@ -645,7 +645,7 @@ save_image (GFile   *file,
                    "  %u, %u, %u,\n",
                    width,
                    height,
-                   config->rgb565 ? 2 : (config->alpha ? 4 : 3)))
+                   bpp))
         goto fail;
     }
   else /* use macros */
@@ -653,10 +653,10 @@ save_image (GFile   *file,
       if (! print (output, error,
                    "#define %s_WIDTH (%u)\n"
                    "#define %s_HEIGHT (%u)\n"
-                   "#define %s_BYTES_PER_PIXEL (%u) /* 3:RGB, 4:RGBA */\n",
+                   "#define %s_BYTES_PER_PIXEL (%u) /* 2:RGB16, 3:RGB, 4:RGBA */\n",
                    macro_name, width,
                    macro_name, height,
-                   macro_name, config->alpha ? 4 : 3))
+                   macro_name, bpp))
         {
           goto fail;
         }
@@ -773,7 +773,7 @@ save_image (GFile   *file,
                        "%u * %u * %u + 1] =\n",
                        width,
                        height,
-                       config->alpha ? 4 : 3))
+                       bpp))
             goto fail;
         }
 


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