diff --git a/ChangeLog b/ChangeLog index 6fd7602a8d..e0398d0f5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-10-06 Sven Neumann + + * app/core/gimpimage-colormap.c (gimp_image_set_colormap): don't + delete the colormap on indexed images. Fixes bug #483887. + 2007-10-06 Sven Neumann * app/core/gimpimage-colormap.c (gimp_image_set_colormap): set all diff --git a/app/core/gimpimage-colormap.c b/app/core/gimpimage-colormap.c index 8333d65578..526d0ac66f 100644 --- a/app/core/gimpimage-colormap.c +++ b/app/core/gimpimage-colormap.c @@ -62,16 +62,17 @@ gimp_image_set_colormap (GimpImage *image, if (push_undo) gimp_image_undo_push_image_colormap (image, _("Set Colormap")); + if (image->cmap) + memset (image->cmap, 0, GIMP_IMAGE_COLORMAP_SIZE); + if (cmap) { - if (image->cmap) - memset (image->cmap, 0, GIMP_IMAGE_COLORMAP_SIZE); - else + if (! image->cmap) image->cmap = g_new0 (guchar, GIMP_IMAGE_COLORMAP_SIZE); memcpy (image->cmap, cmap, n_colors * 3); } - else + else if (! image->base_type == GIMP_INDEXED) { if (image->cmap) g_free (image->cmap);