Commit 5b5d88a2 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

file-png: Get num_colors properly before passing it on

parent 838ba0b7
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment