mirror of
https://github.com/nginx/nginx.git
synced 2024-12-19 05:33:52 -06:00
Image filter: configuration inheritance fixes.
The image_filter_jpeg_quality, image_filter_sharpen and "image_filter rotate" were inherited incorrectly if a directive with variables was defined, and then redefined to a literal value, i.e. in configurations like image_filter_jpeg_quality $arg_q; location / { image_filter_jpeg_quality 50; } Patch by Ian Babrou, with minor changes.
This commit is contained in:
parent
f4b9d89103
commit
717acb74a7
@ -1200,22 +1200,30 @@ ngx_http_image_filter_merge_conf(ngx_conf_t *cf, void *parent, void *child)
|
||||
}
|
||||
}
|
||||
|
||||
/* 75 is libjpeg default quality */
|
||||
ngx_conf_merge_uint_value(conf->jpeg_quality, prev->jpeg_quality, 75);
|
||||
if (conf->jpeg_quality == NGX_CONF_UNSET_UINT) {
|
||||
|
||||
if (conf->jqcv == NULL) {
|
||||
conf->jqcv = prev->jqcv;
|
||||
/* 75 is libjpeg default quality */
|
||||
ngx_conf_merge_uint_value(conf->jpeg_quality, prev->jpeg_quality, 75);
|
||||
|
||||
if (conf->jqcv == NULL) {
|
||||
conf->jqcv = prev->jqcv;
|
||||
}
|
||||
}
|
||||
|
||||
ngx_conf_merge_uint_value(conf->sharpen, prev->sharpen, 0);
|
||||
if (conf->sharpen == NGX_CONF_UNSET_UINT) {
|
||||
ngx_conf_merge_uint_value(conf->sharpen, prev->sharpen, 0);
|
||||
|
||||
if (conf->shcv == NULL) {
|
||||
conf->shcv = prev->shcv;
|
||||
if (conf->shcv == NULL) {
|
||||
conf->shcv = prev->shcv;
|
||||
}
|
||||
}
|
||||
|
||||
ngx_conf_merge_uint_value(conf->angle, prev->angle, 0);
|
||||
if (conf->acv == NULL) {
|
||||
conf->acv = prev->acv;
|
||||
if (conf->angle == NGX_CONF_UNSET_UINT) {
|
||||
ngx_conf_merge_uint_value(conf->angle, prev->angle, 0);
|
||||
|
||||
if (conf->acv == NULL) {
|
||||
conf->acv = prev->acv;
|
||||
}
|
||||
}
|
||||
|
||||
ngx_conf_merge_value(conf->transparency, prev->transparency, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user