diff --git a/ChangeLog b/ChangeLog index 36780fc028..23fd3ee07c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Jul 6 12:02:43 PDT 1998 Manish Singh + + * app/convert.c: check for > 256 colors palettes when indexing, + since the code doesn't handle it (from Yasuhiro SHIRASAKI) + Mon Jul 6 13:18:12 1998 Scott Goehring * pixmaps.h pixmaps2.h tools.c: splits pixmaps up into two headers diff --git a/app/convert.c b/app/convert.c index f66913e4f9..cc8732f8ca 100644 --- a/app/convert.c +++ b/app/convert.c @@ -554,13 +554,16 @@ build_palette_menu(int *default_palette){ UserHasWebPal = TRUE; } - menu_item = gtk_menu_item_new_with_label (entries->name); - gtk_signal_connect( GTK_OBJECT(menu_item), "activate", - (GtkSignalFunc) palette_entries_callback, - (gpointer)entries); - gtk_container_add(GTK_CONTAINER(menu), menu_item); - gtk_widget_show(menu_item); - if (theCustomPalette == entries) *default_palette = i; + /* We can't dither to > 256 colors */ + if (entries->n_colors <= 256) { + menu_item = gtk_menu_item_new_with_label (entries->name); + gtk_signal_connect( GTK_OBJECT(menu_item), "activate", + (GtkSignalFunc) palette_entries_callback, + (gpointer)entries); + gtk_container_add(GTK_CONTAINER(menu), menu_item); + gtk_widget_show(menu_item); + if (theCustomPalette == entries) *default_palette = i; + } } /* default to first one (only used if 'web' palette not avail.) */ diff --git a/app/core/gimpimage-convert.c b/app/core/gimpimage-convert.c index f66913e4f9..cc8732f8ca 100644 --- a/app/core/gimpimage-convert.c +++ b/app/core/gimpimage-convert.c @@ -554,13 +554,16 @@ build_palette_menu(int *default_palette){ UserHasWebPal = TRUE; } - menu_item = gtk_menu_item_new_with_label (entries->name); - gtk_signal_connect( GTK_OBJECT(menu_item), "activate", - (GtkSignalFunc) palette_entries_callback, - (gpointer)entries); - gtk_container_add(GTK_CONTAINER(menu), menu_item); - gtk_widget_show(menu_item); - if (theCustomPalette == entries) *default_palette = i; + /* We can't dither to > 256 colors */ + if (entries->n_colors <= 256) { + menu_item = gtk_menu_item_new_with_label (entries->name); + gtk_signal_connect( GTK_OBJECT(menu_item), "activate", + (GtkSignalFunc) palette_entries_callback, + (gpointer)entries); + gtk_container_add(GTK_CONTAINER(menu), menu_item); + gtk_widget_show(menu_item); + if (theCustomPalette == entries) *default_palette = i; + } } /* default to first one (only used if 'web' palette not avail.) */ diff --git a/app/gimpimage-convert.c b/app/gimpimage-convert.c index f66913e4f9..cc8732f8ca 100644 --- a/app/gimpimage-convert.c +++ b/app/gimpimage-convert.c @@ -554,13 +554,16 @@ build_palette_menu(int *default_palette){ UserHasWebPal = TRUE; } - menu_item = gtk_menu_item_new_with_label (entries->name); - gtk_signal_connect( GTK_OBJECT(menu_item), "activate", - (GtkSignalFunc) palette_entries_callback, - (gpointer)entries); - gtk_container_add(GTK_CONTAINER(menu), menu_item); - gtk_widget_show(menu_item); - if (theCustomPalette == entries) *default_palette = i; + /* We can't dither to > 256 colors */ + if (entries->n_colors <= 256) { + menu_item = gtk_menu_item_new_with_label (entries->name); + gtk_signal_connect( GTK_OBJECT(menu_item), "activate", + (GtkSignalFunc) palette_entries_callback, + (gpointer)entries); + gtk_container_add(GTK_CONTAINER(menu), menu_item); + gtk_widget_show(menu_item); + if (theCustomPalette == entries) *default_palette = i; + } } /* default to first one (only used if 'web' palette not avail.) */