diff --git a/ChangeLog b/ChangeLog index 4355830578..a252bde6aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Mon Sep 21 02:05:50 PDT 1998 Manish Singh + + * app/text_tool.c: correct test for restoring old foundry in + callback (from Trent Piepho) + + * plug-ins/gauss_iir/gauss_iir.c + * plug-ins/gauss_rle/gauss_rle.c: better test for bad values, + put fix in gauss_rle too + Sun Sep 20 15:52:21 PDT 1998 Manish Singh * Upgraded to libtool 1.2b diff --git a/app/text_tool.c b/app/text_tool.c index 60f7203b66..81a02e422f 100644 --- a/app/text_tool.c +++ b/app/text_tool.c @@ -794,7 +794,7 @@ text_foundry_callback (GtkWidget *w, the_text_tool->foundry = (long) client_data; text_validate_combo (the_text_tool, 0); - if (text_load_font (the_text_tool)) + if (!text_load_font (the_text_tool)) the_text_tool->foundry = old_value; } diff --git a/app/tools/gimptexttool.c b/app/tools/gimptexttool.c index 60f7203b66..81a02e422f 100644 --- a/app/tools/gimptexttool.c +++ b/app/tools/gimptexttool.c @@ -794,7 +794,7 @@ text_foundry_callback (GtkWidget *w, the_text_tool->foundry = (long) client_data; text_validate_combo (the_text_tool, 0); - if (text_load_font (the_text_tool)) + if (!text_load_font (the_text_tool)) the_text_tool->foundry = old_value; } diff --git a/app/tools/text_tool.c b/app/tools/text_tool.c index 60f7203b66..81a02e422f 100644 --- a/app/tools/text_tool.c +++ b/app/tools/text_tool.c @@ -794,7 +794,7 @@ text_foundry_callback (GtkWidget *w, the_text_tool->foundry = (long) client_data; text_validate_combo (the_text_tool, 0); - if (text_load_font (the_text_tool)) + if (!text_load_font (the_text_tool)) the_text_tool->foundry = old_value; } diff --git a/plug-ins/common/gauss_iir.c b/plug-ins/common/gauss_iir.c index 0c1064a6a2..7d74836816 100644 --- a/plug-ins/common/gauss_iir.c +++ b/plug-ins/common/gauss_iir.c @@ -178,8 +178,7 @@ run (gchar *name, bvals.horizontal = (param[4].data.d_int32) ? TRUE : FALSE; bvals.vertical = (param[5].data.d_int32) ? TRUE : FALSE; } - if (status == STATUS_SUCCESS && - (bvals.radius < 1.0)) + if (status == STATUS_SUCCESS && (bvals.radius < 1.0)) status = STATUS_CALLING_ERROR; break; @@ -192,40 +191,50 @@ run (gchar *name, break; } - /* Get the specified drawable */ - drawable = gimp_drawable_get (param[2].data.d_drawable); - - /* Make sure that the drawable is gray or RGB color */ - if (gimp_drawable_color (drawable->id) || gimp_drawable_gray (drawable->id)) + if (!(bvals.horizontal || bvals.vertical)) { - gimp_progress_init ("IIR Gaussian Blur"); - - /* set the tile cache size so that the gaussian blur works well */ - gimp_tile_cache_ntiles (2 * (MAX (drawable->width, drawable->height) / - gimp_tile_width () + 1)); - - radius = fabs (bvals.radius) + 1.0; - std_dev = sqrt (-(radius * radius) / (2 * log (1.0 / 255.0))); - - /* run the gaussian blur */ - gauss_iir (drawable, bvals.horizontal, bvals.vertical, std_dev); - - if (run_mode != RUN_NONINTERACTIVE) - gimp_displays_flush (); - - /* Store data */ - if (run_mode == RUN_INTERACTIVE) - gimp_set_data ("plug_in_gauss_iir", &bvals, sizeof (BlurValues)); + gimp_message ("gauss_iir: you must specify either horizontal or vertical (or both)"); + status = STATUS_CALLING_ERROR; } - else + + if (status == STATUS_SUCCESS) { - /* gimp_message ("gauss_iir: cannot operate on indexed color images"); */ - status = STATUS_EXECUTION_ERROR; + /* Get the specified drawable */ + drawable = gimp_drawable_get (param[2].data.d_drawable); + + /* Make sure that the drawable is gray or RGB color */ + if (gimp_drawable_color (drawable->id) || + gimp_drawable_gray (drawable->id)) + { + gimp_progress_init ("IIR Gaussian Blur"); + + /* set the tile cache size so that the gaussian blur works well */ + gimp_tile_cache_ntiles (2 * (MAX (drawable->width, drawable->height) / + gimp_tile_width () + 1)); + + radius = fabs (bvals.radius) + 1.0; + std_dev = sqrt (-(radius * radius) / (2 * log (1.0 / 255.0))); + + /* run the gaussian blur */ + gauss_iir (drawable, bvals.horizontal, bvals.vertical, std_dev); + + if (run_mode != RUN_NONINTERACTIVE) + gimp_displays_flush (); + + /* Store data */ + if (run_mode == RUN_INTERACTIVE) + gimp_set_data ("plug_in_gauss_iir", &bvals, sizeof (BlurValues)); + } + else + { + gimp_message ("gauss_iir: cannot operate on indexed color images"); + status = STATUS_EXECUTION_ERROR; + } + + gimp_drawable_detach (drawable); } values[0].data.d_status = status; - - gimp_drawable_detach (drawable); } static gint @@ -394,11 +403,6 @@ gauss_iir (GDrawable *drawable, guchar *guc_tmp1, *guc_tmp2; gint *gi_tmp1, *gi_tmp2; -/* Take care of the case that neither horizontal nor vertical is selected */ - if (!(horz || vert)) { - return; - } - gimp_drawable_mask_bounds (drawable->id, &x1, &y1, &x2, &y2); width = (x2 - x1); diff --git a/plug-ins/common/gauss_rle.c b/plug-ins/common/gauss_rle.c index b1d2fd21d8..1d8dc55e61 100644 --- a/plug-ins/common/gauss_rle.c +++ b/plug-ins/common/gauss_rle.c @@ -182,40 +182,50 @@ run (gchar *name, break; } - /* Get the specified drawable */ - drawable = gimp_drawable_get (param[2].data.d_drawable); - - /* Make sure that the drawable is gray or RGB color */ - if (gimp_drawable_color (drawable->id) || gimp_drawable_gray (drawable->id)) + if (!(bvals.horizontal || bvals.vertical)) { - gimp_progress_init ("RLE Gaussian Blur"); - - /* set the tile cache size so that the gaussian blur works well */ - gimp_tile_cache_ntiles (2 * (MAX (drawable->width, drawable->height) / - gimp_tile_width () + 1)); - - radius = fabs (bvals.radius) + 1.0; - std_dev = sqrt (-(radius * radius) / (2 * log (1.0 / 255.0))); - - /* run the gaussian blur */ - gauss_rle (drawable, bvals.horizontal, bvals.vertical, std_dev); - - if (run_mode != RUN_NONINTERACTIVE) - gimp_displays_flush (); - - /* Store data */ - if (run_mode == RUN_INTERACTIVE) - gimp_set_data ("plug_in_gauss_rle", &bvals, sizeof (BlurValues)); + gimp_message ("gauss_rle: you must specify either horizontal or vertical (or both)"); + status = STATUS_CALLING_ERROR; } - else + + if (status == STATUS_SUCCESS) { - /* gimp_message ("gauss_rle: cannot operate on indexed color images"); */ - status = STATUS_EXECUTION_ERROR; - } + /* Get the specified drawable */ + drawable = gimp_drawable_get (param[2].data.d_drawable); + + /* Make sure that the drawable is gray or RGB color */ + if (gimp_drawable_color (drawable->id) || + gimp_drawable_gray (drawable->id)) + { + gimp_progress_init ("RLE Gaussian Blur"); + + /* set the tile cache size so that the gaussian blur works well */ + gimp_tile_cache_ntiles (2 * (MAX (drawable->width, drawable->height) / + gimp_tile_width () + 1)); + + radius = fabs (bvals.radius) + 1.0; + std_dev = sqrt (-(radius * radius) / (2 * log (1.0 / 255.0))); + + /* run the gaussian blur */ + gauss_rle (drawable, bvals.horizontal, bvals.vertical, std_dev); + + if (run_mode != RUN_NONINTERACTIVE) + gimp_displays_flush (); + + /* Store data */ + if (run_mode == RUN_INTERACTIVE) + gimp_set_data ("plug_in_gauss_rle", &bvals, sizeof (BlurValues)); + } + else + { + gimp_message ("gauss_rle: cannot operate on indexed color images"); + status = STATUS_EXECUTION_ERROR; + } + + gimp_drawable_detach (drawable); + } values[0].data.d_status = status; - - gimp_drawable_detach (drawable); } static gint diff --git a/plug-ins/gauss_iir/gauss_iir.c b/plug-ins/gauss_iir/gauss_iir.c index 0c1064a6a2..7d74836816 100644 --- a/plug-ins/gauss_iir/gauss_iir.c +++ b/plug-ins/gauss_iir/gauss_iir.c @@ -178,8 +178,7 @@ run (gchar *name, bvals.horizontal = (param[4].data.d_int32) ? TRUE : FALSE; bvals.vertical = (param[5].data.d_int32) ? TRUE : FALSE; } - if (status == STATUS_SUCCESS && - (bvals.radius < 1.0)) + if (status == STATUS_SUCCESS && (bvals.radius < 1.0)) status = STATUS_CALLING_ERROR; break; @@ -192,40 +191,50 @@ run (gchar *name, break; } - /* Get the specified drawable */ - drawable = gimp_drawable_get (param[2].data.d_drawable); - - /* Make sure that the drawable is gray or RGB color */ - if (gimp_drawable_color (drawable->id) || gimp_drawable_gray (drawable->id)) + if (!(bvals.horizontal || bvals.vertical)) { - gimp_progress_init ("IIR Gaussian Blur"); - - /* set the tile cache size so that the gaussian blur works well */ - gimp_tile_cache_ntiles (2 * (MAX (drawable->width, drawable->height) / - gimp_tile_width () + 1)); - - radius = fabs (bvals.radius) + 1.0; - std_dev = sqrt (-(radius * radius) / (2 * log (1.0 / 255.0))); - - /* run the gaussian blur */ - gauss_iir (drawable, bvals.horizontal, bvals.vertical, std_dev); - - if (run_mode != RUN_NONINTERACTIVE) - gimp_displays_flush (); - - /* Store data */ - if (run_mode == RUN_INTERACTIVE) - gimp_set_data ("plug_in_gauss_iir", &bvals, sizeof (BlurValues)); + gimp_message ("gauss_iir: you must specify either horizontal or vertical (or both)"); + status = STATUS_CALLING_ERROR; } - else + + if (status == STATUS_SUCCESS) { - /* gimp_message ("gauss_iir: cannot operate on indexed color images"); */ - status = STATUS_EXECUTION_ERROR; + /* Get the specified drawable */ + drawable = gimp_drawable_get (param[2].data.d_drawable); + + /* Make sure that the drawable is gray or RGB color */ + if (gimp_drawable_color (drawable->id) || + gimp_drawable_gray (drawable->id)) + { + gimp_progress_init ("IIR Gaussian Blur"); + + /* set the tile cache size so that the gaussian blur works well */ + gimp_tile_cache_ntiles (2 * (MAX (drawable->width, drawable->height) / + gimp_tile_width () + 1)); + + radius = fabs (bvals.radius) + 1.0; + std_dev = sqrt (-(radius * radius) / (2 * log (1.0 / 255.0))); + + /* run the gaussian blur */ + gauss_iir (drawable, bvals.horizontal, bvals.vertical, std_dev); + + if (run_mode != RUN_NONINTERACTIVE) + gimp_displays_flush (); + + /* Store data */ + if (run_mode == RUN_INTERACTIVE) + gimp_set_data ("plug_in_gauss_iir", &bvals, sizeof (BlurValues)); + } + else + { + gimp_message ("gauss_iir: cannot operate on indexed color images"); + status = STATUS_EXECUTION_ERROR; + } + + gimp_drawable_detach (drawable); } values[0].data.d_status = status; - - gimp_drawable_detach (drawable); } static gint @@ -394,11 +403,6 @@ gauss_iir (GDrawable *drawable, guchar *guc_tmp1, *guc_tmp2; gint *gi_tmp1, *gi_tmp2; -/* Take care of the case that neither horizontal nor vertical is selected */ - if (!(horz || vert)) { - return; - } - gimp_drawable_mask_bounds (drawable->id, &x1, &y1, &x2, &y2); width = (x2 - x1); diff --git a/plug-ins/gauss_rle/gauss_rle.c b/plug-ins/gauss_rle/gauss_rle.c index b1d2fd21d8..1d8dc55e61 100644 --- a/plug-ins/gauss_rle/gauss_rle.c +++ b/plug-ins/gauss_rle/gauss_rle.c @@ -182,40 +182,50 @@ run (gchar *name, break; } - /* Get the specified drawable */ - drawable = gimp_drawable_get (param[2].data.d_drawable); - - /* Make sure that the drawable is gray or RGB color */ - if (gimp_drawable_color (drawable->id) || gimp_drawable_gray (drawable->id)) + if (!(bvals.horizontal || bvals.vertical)) { - gimp_progress_init ("RLE Gaussian Blur"); - - /* set the tile cache size so that the gaussian blur works well */ - gimp_tile_cache_ntiles (2 * (MAX (drawable->width, drawable->height) / - gimp_tile_width () + 1)); - - radius = fabs (bvals.radius) + 1.0; - std_dev = sqrt (-(radius * radius) / (2 * log (1.0 / 255.0))); - - /* run the gaussian blur */ - gauss_rle (drawable, bvals.horizontal, bvals.vertical, std_dev); - - if (run_mode != RUN_NONINTERACTIVE) - gimp_displays_flush (); - - /* Store data */ - if (run_mode == RUN_INTERACTIVE) - gimp_set_data ("plug_in_gauss_rle", &bvals, sizeof (BlurValues)); + gimp_message ("gauss_rle: you must specify either horizontal or vertical (or both)"); + status = STATUS_CALLING_ERROR; } - else + + if (status == STATUS_SUCCESS) { - /* gimp_message ("gauss_rle: cannot operate on indexed color images"); */ - status = STATUS_EXECUTION_ERROR; - } + /* Get the specified drawable */ + drawable = gimp_drawable_get (param[2].data.d_drawable); + + /* Make sure that the drawable is gray or RGB color */ + if (gimp_drawable_color (drawable->id) || + gimp_drawable_gray (drawable->id)) + { + gimp_progress_init ("RLE Gaussian Blur"); + + /* set the tile cache size so that the gaussian blur works well */ + gimp_tile_cache_ntiles (2 * (MAX (drawable->width, drawable->height) / + gimp_tile_width () + 1)); + + radius = fabs (bvals.radius) + 1.0; + std_dev = sqrt (-(radius * radius) / (2 * log (1.0 / 255.0))); + + /* run the gaussian blur */ + gauss_rle (drawable, bvals.horizontal, bvals.vertical, std_dev); + + if (run_mode != RUN_NONINTERACTIVE) + gimp_displays_flush (); + + /* Store data */ + if (run_mode == RUN_INTERACTIVE) + gimp_set_data ("plug_in_gauss_rle", &bvals, sizeof (BlurValues)); + } + else + { + gimp_message ("gauss_rle: cannot operate on indexed color images"); + status = STATUS_EXECUTION_ERROR; + } + + gimp_drawable_detach (drawable); + } values[0].data.d_status = status; - - gimp_drawable_detach (drawable); } static gint