plug-ins/winicon/icodialog.c fixed handling of indexed images (bug

2006-08-24  Sven Neumann  <sven@gimp.org>

	* plug-ins/winicon/icodialog.c
	* plug-ins/winicon/icosave.c: fixed handling of indexed images
	(bug #342883).
This commit is contained in:
Sven Neumann 2006-08-24 15:07:04 +00:00 committed by Sven Neumann
parent 62b28f4452
commit a1b1fb7530
3 changed files with 29 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2006-08-24 Sven Neumann <sven@gimp.org>
* plug-ins/winicon/icodialog.c
* plug-ins/winicon/icosave.c: fixed handling of indexed images
(bug #342883).
2006-08-24 Sven Neumann <sven@gimp.org>
* configure.in: add -Wdeclaration_after_statement to the CFLAGS if

View File

@ -251,7 +251,20 @@ ico_specs_dialog_update_icon_preview (GtkWidget *dialog,
guchar *buffer;
image = gimp_drawable_get_image (layer);
tmp_image = gimp_image_new (w, h, gimp_image_base_type (image));
gimp_image_undo_disable (tmp_image);
if (gimp_drawable_is_indexed (layer))
{
guchar *cmap;
gint num_colors;
cmap = gimp_image_get_colormap (image, &num_colors);
gimp_image_set_colormap (tmp_image, cmap, num_colors);
g_free (cmap);
}
tmp_layer = gimp_layer_new (tmp_image, "temporary", w, h,
gimp_drawable_type (layer),
100, GIMP_NORMAL_MODE);

View File

@ -883,6 +883,16 @@ ico_image_get_reduced_buf (guint32 layer,
gimp_image_base_type (image));
gimp_image_undo_disable (tmp_image);
if (gimp_drawable_is_indexed (layer))
{
guchar *cmap;
gint num_colors;
cmap = gimp_image_get_colormap (image, &num_colors);
gimp_image_set_colormap (tmp_image, cmap, num_colors);
g_free (cmap);
}
tmp_layer = gimp_layer_new (tmp_image, "tmp", w, h,
gimp_drawable_type (layer),
100, GIMP_NORMAL_MODE);