aboutsummaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2021-11-29 21:09:33 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2021-11-29 21:09:33 +0300
commit62d52b597d6a9cf4ed7ef0782fad8ca5eca24aa0 (patch)
treee6cf0ac8a92f7a26b5bc36ee821add9741042fd8 /src/config.c
parent8e07de9d952f8f27273296f1b6ae58550ce1e98b (diff)
downloadrevela-62d52b597d6a9cf4ed7ef0782fad8ca5eca24aa0.tar.gz
revela-62d52b597d6a9cf4ed7ef0782fad8ca5eca24aa0.zip
config: blur setting for thumbnails/images
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index e9dd609..1bc531f 100644
--- a/src/config.c
+++ b/src/config.c
@@ -75,6 +75,18 @@ site_config_images_keyvalue_handler(struct parcini_line *parsed,
res = parcini_value_handle(&parsed->value, PARCINI_VALUE_BOOLEAN,
&iconfig->smart_resize) ? CONFIG_KEY_OK : CONFIG_KEY_BADVALUE;
}
+ if (!strcmp(parsed->key, "blur")) {
+ long int temp;
+ res = parcini_value_handle(&parsed->value, PARCINI_VALUE_INTEGER,
+ &temp) ? CONFIG_KEY_OK : CONFIG_KEY_BADVALUE;
+ if (res == CONFIG_KEY_OK) {
+ if (temp < -100 || temp > 100) {
+ res = CONFIG_KEY_BADVALUE;
+ } else {
+ iconfig->blur = (double)temp/100;
+ }
+ }
+ }
return res;
}
@@ -227,6 +239,7 @@ site_config_init(void)
.max_width = 3000,
.max_height = 2000,
.smart_resize = true,
+ .blur = 0,
};
config->thumbnails = (struct image_config) {
.strip = true,
@@ -234,6 +247,7 @@ site_config_init(void)
.max_width = 400,
.max_height = 270,
.smart_resize = true,
+ .blur = 0.25,
};
}