# HG changeset patch # User Ruslan Ermilov # Date 1322215052 0 # Node ID eed54ef191970398c4b72bd181bdca60ede0c764 # Parent 876d36c69e01e44f2dd6589db3e95bf5e24a701d English translation of the ngx_http_image_filter_module documentation. diff -r 876d36c69e01 -r eed54ef19197 xml/en/GNUmakefile --- a/xml/en/GNUmakefile Fri Nov 25 09:54:13 2011 +0000 +++ b/xml/en/GNUmakefile Fri Nov 25 09:57:32 2011 +0000 @@ -28,6 +28,7 @@ en/docs/http/ngx_http_empty_gif_module \ en/docs/http/ngx_http_flv_module \ en/docs/http/ngx_http_index_module \ + en/docs/http/ngx_http_image_filter_module \ en/docs/http/ngx_http_limit_conn_module \ en/docs/http/ngx_http_limit_req_module \ en/docs/http/ngx_http_mp4_module \ diff -r 876d36c69e01 -r eed54ef19197 xml/en/docs/http/ngx_http_image_filter_module.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xml/en/docs/http/ngx_http_image_filter_module.xml Fri Nov 25 09:57:32 2011 +0000 @@ -0,0 +1,213 @@ + + + + + + +
+ + +The ngx_http_image_filter_module module is a filter +that transforms images in JPEG, GIF, and PNG (0.7.54+) formats. + + + +This module is not built by default, it should be enabled with the +--with-http_image_filter_module +configuration parameter. + +This module utilizes the +libgd library. +It is recommended to use the latest available version of the library; +it is version 2.0.35 as of this writing. + + + +
+ + +
+ + + +location /img/ { + proxy_pass http://backend; + image_filter resize 150 100; + image_filter rotate 90; + error_page 415 = /empty; +} + +location = /empty { + empty_gif; +} + + + +
+ + +
+ + + off + test + size + rotate + 90 | 180 | 270 + + + resize + width height + + + crop + width height + + +location + + +Sets the type of transformation to perform on images: + + +off + +turns off module processing in a surrounding location. + + +test + +ensures that answers are images in either JPEG, GIF, or PNG format. +Otherwise, the error + +is returned. + + +size + +outputs information about images in a JSON format, e.g.: + +{ "img" : { "width": 100, "height": 100, "type": "gif" } } + +In case of an error, the following is output: + +{} + + + +rotate +90|180|270 + + +rotates images counter-clockwise by the specified number of degrees. +The argument value can contain variables. +Can be used either alone, or along with the +resize and crop transformations. + + +resize +width height + + +proportionally reduces an image to the specified sizes. +To reduce by only one dimension, another dimension can be specified as +“-”. +In case of an error, the server will return code +. +Values of arguments can contain variables. +When used along with the rotate parameter, +the rotation happens after reduction. + + +crop +width height + + +proportionally reduces an image to the size of the largest side +and crops extraneous edges by another side. +To reduce by only one dimension, another dimension can be specified as +“-”. +In case of an error, the server will return code +. +Values of arguments can contain variables. +When used along with the rotate parameter, +the rotation happens before reduction. + + + + + + + + + +size +1M +http +server +location + + +Sets the maximum size of the buffer used for reading images. +When a size is exceeded the server will return error +. + + + + + + +1..100 +75 +http +server +location + + +Sets the desired quality of the transformed JPEG images. +Lesser values usually imply both lower quality and smaller image sizes. +The maximum recommended value is 95. +The argument value can contain variables. + + + + + + +percent +0 +http +server +location + + +Increases sharpness of the final image. +The sharpness percentage can exceed 100. +The value of 0 disables sharpening. +The argument value can contain variables. + + + + + + +on|off +on +http +server +location + + +Defines whether transparency should be preserved when transforming +PNG images with colors specified by a palette, or in GIF images. +The loss of transparency allows to obtain images of a better quality. +The alpha channel transparency in PNG is always preserved. + + + + +
+ +
diff -r 876d36c69e01 -r eed54ef19197 xml/en/docs/index.xml --- a/xml/en/docs/index.xml Fri Nov 25 09:54:13 2011 +0000 +++ b/xml/en/docs/index.xml Fri Nov 25 09:57:32 2011 +0000 @@ -72,6 +72,11 @@ + +ngx_http_image_filter_module + + + ngx_http_limit_conn_module diff -r 876d36c69e01 -r eed54ef19197 xml/en/index.xml --- a/xml/en/index.xml Fri Nov 25 09:54:13 2011 +0000 +++ b/xml/en/index.xml Fri Nov 25 09:57:32 2011 +0000 @@ -58,7 +58,8 @@ Modular architecture. Filters include gzipping, byte ranges, chunked responses, XSLT, SSI, -and image resizing filter. +and image +transformation filter. Multiple SSI inclusions within a single page can be processed in parallel if they are handled by proxied or FastCGI servers;