[gimp] file-png: Get num_colors properly before passing it on



commit 5b5d88a2f1d9f0e37d07b24148f76a14d0f2789b
Author: Mukund Sivaraman <muks banu com>
Date:   Tue Apr 26 15:18:27 2011 +0530

    file-png: Get num_colors properly before passing it on

 plug-ins/common/file-png.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/plug-ins/common/file-png.c b/plug-ins/common/file-png.c
index 10a2f11..b16dbf5 100644
--- a/plug-ins/common/file-png.c
+++ b/plug-ins/common/file-png.c
@@ -1230,6 +1230,7 @@ save_image (const gchar  *filename,
   struct tm *gmt;               /* GMT broken down */
   int color_type;
   int bit_depth;
+  png_colorp palette;
 
   guchar remap[256];            /* Re-mapping for the palette */
 
@@ -1354,9 +1355,8 @@ save_image (const gchar  *filename,
     case GIMP_INDEXED_IMAGE:
       bpp = 1;
       color_type = PNG_COLOR_TYPE_PALETTE;
-      png_set_PLTE (pp, info,
-                    (png_colorp) gimp_image_get_colormap (image_ID, &num_colors),
-                    num_colors);
+      palette = (png_colorp) gimp_image_get_colormap (image_ID, &num_colors);
+      png_set_PLTE (pp, info, palette, num_colors);
       bit_depth = get_bit_depth_for_palette (num_colors);
       break;
 



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