mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-22 20:41:43 +00:00
file-png: Get num_colors properly before passing it on
This commit is contained in:
parent
838ba0b78e
commit
5b5d88a2f1
|
@ -1230,6 +1230,7 @@ save_image (const gchar *filename,
|
||||||
struct tm *gmt; /* GMT broken down */
|
struct tm *gmt; /* GMT broken down */
|
||||||
int color_type;
|
int color_type;
|
||||||
int bit_depth;
|
int bit_depth;
|
||||||
|
png_colorp palette;
|
||||||
|
|
||||||
guchar remap[256]; /* Re-mapping for the palette */
|
guchar remap[256]; /* Re-mapping for the palette */
|
||||||
|
|
||||||
|
@ -1354,9 +1355,8 @@ save_image (const gchar *filename,
|
||||||
case GIMP_INDEXED_IMAGE:
|
case GIMP_INDEXED_IMAGE:
|
||||||
bpp = 1;
|
bpp = 1;
|
||||||
color_type = PNG_COLOR_TYPE_PALETTE;
|
color_type = PNG_COLOR_TYPE_PALETTE;
|
||||||
png_set_PLTE (pp, info,
|
palette = (png_colorp) gimp_image_get_colormap (image_ID, &num_colors);
|
||||||
(png_colorp) gimp_image_get_colormap (image_ID, &num_colors),
|
png_set_PLTE (pp, info, palette, num_colors);
|
||||||
num_colors);
|
|
||||||
bit_depth = get_bit_depth_for_palette (num_colors);
|
bit_depth = get_bit_depth_for_palette (num_colors);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue