From cd3ca47cc138a03b2a4e9678fd8f7a7eed8e654d Mon Sep 17 00:00:00 2001 From: Ell Date: Fri, 7 Jul 2017 03:45:20 -0400 Subject: [PATCH] Bug 784462 - Export in C source format reports wrong BPP/buffer-size ... ... when using macros + RGB565 --- plug-ins/common/file-csource.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plug-ins/common/file-csource.c b/plug-ins/common/file-csource.c index 24724e25b1..9e31a993e1 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; }