don't delete the colormap on indexed images. Fixes bug #483887.
2007-10-06 Sven Neumann <sven@gimp.org> * app/core/gimpimage-colormap.c (gimp_image_set_colormap): don't delete the colormap on indexed images. Fixes bug #483887. svn path=/trunk/; revision=23749
This commit is contained in:
parent
9a87143a0c
commit
f28665a0d1
2 changed files with 10 additions and 4 deletions
|
|
@ -1,3 +1,8 @@
|
|||
2007-10-06 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* 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 <sven@gimp.org>
|
||||
|
||||
* app/core/gimpimage-colormap.c (gimp_image_set_colormap): set all
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue