From 13a5ec3802c63e1fac4b90301f0caabeccc8d833 Mon Sep 17 00:00:00 2001 From: Erik Auerswald Date: Sat, 1 Feb 2025 19:26:09 +0100 Subject: [PATCH] imgproc.c: remove some useless code The removed code was intended to clear the image to allow only drawing foreground pixels in the following loop. But it only drew the outline of a rectangle and thus did not clear the image as intended. Since the image is not cleared, the following loop already draws every pixel, overwriting any previously drawn rectangle anyway. --- imgproc.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/imgproc.c b/imgproc.c index 5357ce7..6155679 100644 --- a/imgproc.c +++ b/imgproc.c @@ -260,12 +260,6 @@ Imlib_Image keep_pixels_filter(Imlib_Image *source_image, double thresh, width = imlib_image_get_width(); new_image = imlib_clone_image(); - /* draw white (background) rectangle to clear new image */ - imlib_context_set_image(new_image); - ssocr_set_color(BG); - imlib_image_draw_rectangle(0, 0, width, height); - imlib_context_set_image(*source_image); - /* check for every pixel if it should be set in filtered image */ for(x=0; x