Skip to content

Commit e556c2e

Browse files
victoryforceTurboGit
authored andcommitted
Soft limit blur radius to protect from long processing time
1 parent ecdea18 commit e556c2e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/iop/blurs.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of darktable,
3-
Copyright (C) 2021-2024 darktable developers.
3+
Copyright (C) 2021-2025 darktable developers.
44
55
darktable is free software: you can redistribute it and/or modify
66
it under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@
1515
You should have received a copy of the GNU General Public License
1616
along with darktable. If not, see <http://www.gnu.org/licenses/>.
1717
*/
18-
// our includes go first:
18+
1919
#include "bauhaus/bauhaus.h"
2020
#include "common/dwt.h"
2121
#include "develop/imageop.h"
@@ -766,6 +766,14 @@ void gui_init(dt_iop_module_t *self)
766766
g->radius = dt_bauhaus_slider_from_params(self, "radius");
767767
dt_bauhaus_slider_set_format(g->radius, " px");
768768

769+
// The current implementation's run time is proportional to the square of
770+
// the blur radius. Let's soft-limit it to protect users from unacceptably
771+
// long processing times for the full image (like when exporting), which
772+
// many users perceive as a hang.
773+
// NOTE: This is just quick damage control. The correct solution is to
774+
// replace the bad implementation with a more efficient one.
775+
dt_bauhaus_slider_set_soft_max(g->radius, 64);
776+
769777
g->type = dt_bauhaus_combobox_from_params(self, "type");
770778

771779
g->blades = dt_bauhaus_slider_from_params(self, "blades");

0 commit comments

Comments
 (0)