Lift the MAX_BLUR_PASS limit
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
@ -379,10 +379,12 @@ char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shad
|
||||
// --blur-background-fixed
|
||||
lcfg_lookup_bool(&cfg, "blur-background-fixed", &opt->blur_background_fixed);
|
||||
// --blur-kern
|
||||
if (config_lookup_string(&cfg, "blur-kern", &sval) &&
|
||||
!parse_blur_kern_lst(sval, opt->blur_kerns, MAX_BLUR_PASS, conv_kern_hasneg)) {
|
||||
log_fatal("Cannot parse \"blur-kern\"");
|
||||
goto err;
|
||||
if (config_lookup_string(&cfg, "blur-kern", &sval)) {
|
||||
opt->blur_kerns = parse_blur_kern_lst(sval, conv_kern_hasneg);
|
||||
if (!opt->blur_kerns) {
|
||||
log_fatal("Cannot parse \"blur-kern\"");
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
// --resize-damage
|
||||
config_lookup_int(&cfg, "resize-damage", &opt->resize_damage);
|
||||
@ -448,7 +450,6 @@ char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shad
|
||||
}
|
||||
|
||||
config_setting_t *blur_cfg = config_lookup(&cfg, "blur");
|
||||
// This is not a loop
|
||||
if (blur_cfg) {
|
||||
if (config_setting_lookup_string(blur_cfg, "method", &sval)) {
|
||||
enum blur_method method = parse_blur_method(sval);
|
||||
@ -463,12 +464,9 @@ char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shad
|
||||
config_setting_lookup_int(blur_cfg, "size", &opt->blur_radius);
|
||||
|
||||
if (config_setting_lookup_string(blur_cfg, "kernel", &sval)) {
|
||||
struct conv *kerns[5];
|
||||
if (!parse_blur_kern_lst(sval, kerns, MAX_BLUR_PASS,
|
||||
conv_kern_hasneg)) {
|
||||
opt->blur_kerns = parse_blur_kern_lst(sval, conv_kern_hasneg);
|
||||
if (!opt->blur_kerns) {
|
||||
log_warn("Failed to parse blur kernel: %s", sval);
|
||||
} else {
|
||||
memcpy(opt->blur_kerns, kerns, sizeof kerns);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user