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

ru at nginx.com ru at nginx.com
Tue Mar 19 08:13:49 UTC 2013


Author: ru
Date: 2013-03-19 08:13:48 +0000 (Tue, 19 Mar 2013)
New Revision: 5119
URL: http://trac.nginx.org/nginx/changeset/5119/nginx

Log:
Image filter: the "image_filter_interlace" directive.

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	2013-03-18 14:50:29 UTC (rev 5118)
+++ trunk/src/http/modules/ngx_http_image_filter_module.c	2013-03-19 08:13:48 UTC (rev 5119)
@@ -45,6 +45,7 @@
     ngx_uint_t                   sharpen;
 
     ngx_flag_t                   transparency;
+    ngx_flag_t                   interlace;
 
     ngx_http_complex_value_t    *wcv;
     ngx_http_complex_value_t    *hcv;
@@ -143,6 +144,13 @@
       offsetof(ngx_http_image_filter_conf_t, transparency),
       NULL },
 
+   { ngx_string("image_filter_interlace"),
+      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
+      ngx_conf_set_flag_slot,
+      NGX_HTTP_LOC_CONF_OFFSET,
+      offsetof(ngx_http_image_filter_conf_t, interlace),
+      NULL },
+
     { ngx_string("image_filter_buffer"),
       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
       ngx_conf_set_size_slot,
@@ -963,6 +971,8 @@
         gdImageSharpen(dst, sharpen);
     }
 
+    gdImageInterlace(dst, (int) conf->interlace);
+
     out = ngx_http_image_out(r, ctx->type, dst, &size);
 
     ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
@@ -1186,6 +1196,7 @@
     conf->jpeg_quality = NGX_CONF_UNSET_UINT;
     conf->sharpen = NGX_CONF_UNSET_UINT;
     conf->transparency = NGX_CONF_UNSET;
+    conf->interlace = NGX_CONF_UNSET;
     conf->buffer_size = NGX_CONF_UNSET_SIZE;
 
     return conf;
@@ -1234,6 +1245,8 @@
 
     ngx_conf_merge_value(conf->transparency, prev->transparency, 1);
 
+    ngx_conf_merge_value(conf->interlace, prev->interlace, 0);
+
     ngx_conf_merge_size_value(conf->buffer_size, prev->buffer_size,
                               1 * 1024 * 1024);
 



More information about the nginx-devel mailing list