Commit eaebb24a authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

fixed incorrect loop boundaries. Should fix bug #331044.

2006-02-14  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/despeckle.c (despeckle_median): fixed incorrect
	loop boundaries. Should fix bug #331044.
parent 0f25da46
2006-02-14 Sven Neumann <sven@gimp.org>
* plug-ins/common/despeckle.c (despeckle_median): fixed incorrect
loop boundaries. Should fix bug #331044.
2006-02-14 Sven Neumann <sven@gimp.org>
* plug-ins/winicon/icoload.c
......
......@@ -533,33 +533,28 @@ preview_update (GtkWidget *widget)
gint x1,y1;
gint width, height;
img_bpp = gimp_drawable_bpp (drawable->drawable_id);
preview = GIMP_PREVIEW (widget);
img_bpp = gimp_drawable_bpp (drawable->drawable_id);
width = preview->width;
height = preview->height;
/*
* Setup for filter...
*/
gimp_preview_get_position (preview, &x1, &y1);
gimp_pixel_rgn_init (&src_rgn, drawable, x1, y1, width, height, FALSE, FALSE);
/*
* Pre-load the preview rectangle...
*/
dst = g_new (guchar, width * height * img_bpp);
src = g_new (guchar, width * height * img_bpp);
gimp_pixel_rgn_get_rect (&src_rgn, src, x1, y1, width, height);
despeckle_median (src, dst, width, height, img_bpp, despeckle_radius, TRUE);
/*
* Update the screen...
*/
gimp_preview_draw_buffer (preview, dst, width * img_bpp);
g_free (dst);
g_free (src);
g_free (dst);
}
......@@ -631,11 +626,11 @@ despeckle_median (guchar *src,
gint hist255 = 0;
gint count = 0;
for (v = ymin; v <= ymax; v++)
for (v = ymin; v < ymax; v++)
{
gint off2 = v * width * bpp;
for (u = xmin, off2 += xmin * bpp; u <= xmax; u++, off2 += bpp)
for (u = xmin, off2 += xmin * bpp; u < xmax; u++, off2 += bpp)
{
guchar value = pixel_luminance (src + off2, bpp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment