Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r4979 - trunk/src/http/modules

Anonymous User
December 20, 2012 02:06PM
Author: mdounin
Date: 2012-12-20 19:04:28 +0000 (Thu, 20 Dec 2012)
New Revision: 4979
URL: http://trac.nginx.org/nginx/changeset/4979/nginx

Log:
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.


Modified:
trunk/src/http/modules/ngx_http_image_filter_module.c

Modified: trunk/src/http/modules/ngx_http_image_filter_module.c
===================================================================
--- trunk/src/http/modules/ngx_http_image_filter_module.c 2012-12-20 15:34:37 UTC (rev 4978)
+++ trunk/src/http/modules/ngx_http_image_filter_module.c 2012-12-20 19:04:28 UTC (rev 4979)
@@ -1200,22 +1200,30 @@
}
}

- /* 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);

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] svn commit: r4979 - trunk/src/http/modules

Anonymous User 916 December 20, 2012 02:06PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 165
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready