gimp r25349 - in branches/gimp-2-4: . app/core app/pdb tools/pdbgen/pdb
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r25349 - in branches/gimp-2-4: . app/core app/pdb tools/pdbgen/pdb
- Date: Thu, 3 Apr 2008 09:57:13 +0100 (BST)
Author: mitch
Date: Thu Apr 3 09:57:12 2008
New Revision: 25349
URL: http://svn.gnome.org/viewvc/gimp?rev=25349&view=rev
Log:
2008-04-03 Michael Natterer <mitch gimp org>
Merged from trunk:
* app/core/gimpimage-convert.c (gimp_image_convert): don't accept
palettes with more than 256 colors.
* tools/pdbgen/pdb/convert.pdb: fail here too for palettes
with > 256 colors. Fixes bug #525471.
* app/pdb/convert_cmds.c: regenerated.
Modified:
branches/gimp-2-4/ChangeLog
branches/gimp-2-4/app/core/gimpimage-convert.c
branches/gimp-2-4/app/pdb/convert_cmds.c
branches/gimp-2-4/tools/pdbgen/pdb/convert.pdb
Modified: branches/gimp-2-4/app/core/gimpimage-convert.c
==============================================================================
--- branches/gimp-2-4/app/core/gimpimage-convert.c (original)
+++ branches/gimp-2-4/app/core/gimpimage-convert.c Thu Apr 3 09:57:12 2008
@@ -778,6 +778,8 @@
{
g_return_if_fail (custom_palette == NULL ||
GIMP_IS_PALETTE (custom_palette));
+ g_return_if_fail (custom_palette == NULL ||
+ custom_palette->n_colors <= 256);
if (! custom_palette)
palette_type = GIMP_MONO_PALETTE;
Modified: branches/gimp-2-4/app/pdb/convert_cmds.c
==============================================================================
--- branches/gimp-2-4/app/pdb/convert_cmds.c (original)
+++ branches/gimp-2-4/app/pdb/convert_cmds.c Thu Apr 3 09:57:12 2008
@@ -125,7 +125,7 @@
pal = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container,
palette);
- if (pal == NULL)
+ if (pal == NULL || pal->n_colors > 256)
success = FALSE;
break;
@@ -165,7 +165,7 @@
if (success)
{
- gimp_image_convert_set_dither_matrix (width, height, (guchar *) matrix);
+ gimp_image_convert_set_dither_matrix (width, height, (guchar *) matrix);
}
return gimp_procedure_get_return_values (procedure, success);
Modified: branches/gimp-2-4/tools/pdbgen/pdb/convert.pdb
==============================================================================
--- branches/gimp-2-4/tools/pdbgen/pdb/convert.pdb (original)
+++ branches/gimp-2-4/tools/pdbgen/pdb/convert.pdb Thu Apr 3 09:57:12 2008
@@ -132,7 +132,7 @@
pal = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container,
palette);
- if (pal == NULL)
+ if (pal == NULL || pal->n_colors > 256)
success = FALSE;
break;
@@ -177,7 +177,7 @@
%invoke = (
code => <<'CODE'
{
- gimp_image_convert_set_dither_matrix (width, height, (guchar *) matrix);
+ gimp_image_convert_set_dither_matrix (width, height, (guchar *) matrix);
}
CODE
);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]