<div>For now nginx ignore explicit configuration of some image_filter directives.</div><div><br></div><div>For example, in this case nginx will use jpeg quality 10 instead of 80:</div><div><br></div><div><div>server {</div>
<div> listen 8080;</div><div><br></div><div> root /home/bobrik/dev;</div><div><br></div><div> set $arg_q 10;</div><div><br></div><div> image_filter_jpeg_quality $arg_q;<br></div><div><br></div><div> location / {</div>
<div> image_filter_jpeg_quality 80;<br></div><div> image_filter crop 128 128;</div><div> }<br></div><div>}</div></div><div><br></div><div>Maxim pointed me how to fix it, so here's the patch to fix it:</div>
<div><br></div><div><div>diff --git a/ngx_http_image_filter_module.c b/ngx_http_image_filter_module.c</div><div>index c853c33..3aee1a4 100644</div><div>--- a/ngx_http_image_filter_module.c</div><div>+++ b/ngx_http_image_filter_module.c</div>
<div>@@ -1201,21 +1201,28 @@ ngx_http_image_filter_merge_conf(ngx_conf_t *cf, void *parent, void *child)</div><div> }</div><div> </div><div> /* 75 is libjpeg default quality */</div><div>- ngx_conf_merge_uint_value(conf->jpeg_quality, prev->jpeg_quality, 75);</div>
<div>+ if (conf->jpeg_quality == NGX_CONF_UNSET_UINT) {</div><div>+ ngx_conf_merge_uint_value(conf->jpeg_quality, prev->jpeg_quality, 75);</div><div> </div><div>- if (conf->jqcv == NULL) {</div><div>
- conf->jqcv = prev->jqcv;</div><div>+ if (conf->jqcv == NULL) {</div><div>+ conf->jqcv = prev->jqcv;</div><div>+ }</div><div> }</div><div> </div><div>- ngx_conf_merge_uint_value(conf->sharpen, prev->sharpen, 0);</div>
<div>+ if (conf->sharpen == NGX_CONF_UNSET_UINT) {</div><div>+ ngx_conf_merge_uint_value(conf->sharpen, prev->sharpen, 0);</div><div> </div><div>- if (conf->shcv == NULL) {</div><div>- conf->shcv = prev->shcv;</div>
<div>+ if (conf->shcv == NULL) {</div><div>+ conf->shcv = prev->shcv;</div><div>+ }</div><div> }</div><div> </div><div>- ngx_conf_merge_uint_value(conf->angle, prev->angle, 0);</div>
<div>- if (conf->acv == NULL) {</div><div>- conf->acv = prev->acv;</div><div>+ if (conf->angle == NGX_CONF_UNSET_UINT) {</div><div>+ ngx_conf_merge_uint_value(conf->angle, prev->angle, 0);</div>
<div>+</div><div>+ if (conf->acv == NULL) {</div><div>+ conf->acv = prev->acv;</div><div>+ }</div><div> }</div><div> </div><div> ngx_conf_merge_value(conf->transparency, prev->transparency, 1);</div>
<div><br></div>-- <br>Regards, Ian Babrou<br><a href="http://bobrik.name" target="_blank">http://bobrik.name</a> <a href="http://twitter.com/ibobrik" target="_blank">http://twitter.com/ibobrik</a> skype:i.babrou<br>
</div>