annotate xml/en/docs/http/ngx_http_image_filter_module.xml @ 3011:55d49eb065ac

Fixed example in the js_periodic directive.
author Yaroslav Zhuravlev <yar@nginx.com>
date Thu, 14 Sep 2023 16:38:00 +0100
parents 6ebdef43330a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
222
bfe3eff81d04 Removed redundant encoding specification.
Ruslan Ermilov <ru@nginx.com>
parents: 205
diff changeset
1 <?xml version="1.0"?>
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
2
580
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
3 <!--
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
4 Copyright (C) Igor Sysoev
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
5 Copyright (C) Nginx, Inc.
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
6 -->
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
7
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
9
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
10 <module name="Module ngx_http_image_filter_module"
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
11 link="/en/docs/http/ngx_http_image_filter_module.html"
589
764fbac1b8b4 Added document revision.
Ruslan Ermilov <ru@nginx.com>
parents: 580
diff changeset
12 lang="en"
1830
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
13 rev="4">
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
14
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
15 <section id="summary">
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
16
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
17 <para>
347
daae2b619815 Specify the module history information in a unified place.
Ruslan Ermilov <ru@nginx.com>
parents: 294
diff changeset
18 The <literal>ngx_http_image_filter_module</literal> module (0.7.54+) is a filter
1830
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
19 that transforms images in JPEG, GIF, PNG, and WebP formats.
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
20 </para>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
21
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
22 <para>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
23 This module is not built by default, it should be enabled with the
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
24 <literal>--with-http_image_filter_module</literal>
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
25 configuration parameter.
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
26 <note>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
27 This module utilizes the
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
28 <link url="http://libgd.org">libgd</link> library.
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 873
diff changeset
29 It is recommended to use the latest available version of the library.
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
30 </note>
1830
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
31 <note>
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
32 The WebP format support appeared in version 1.11.6.
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
33 To transform images in this format,
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
34 the <literal>libgd</literal> library must be compiled with the WebP support.
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
35 </note>
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
36 </para>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
37
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
38 </section>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
39
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
40
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
41 <section id="example" name="Example Configuration">
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
42
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
43 <para>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
44 <example>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
45 location /img/ {
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
46 proxy_pass http://backend;
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
47 image_filter resize 150 100;
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
48 image_filter rotate 90;
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
49 error_page 415 = /empty;
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
50 }
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
51
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
52 location = /empty {
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
53 empty_gif;
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
54 }
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
55 </example>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
56 </para>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
57
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
58 </section>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
59
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
60
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
61 <section id="directives" name="Directives">
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
62
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
63 <directive name="image_filter">
364
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 347
diff changeset
64 <syntax><literal>off</literal></syntax>
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 347
diff changeset
65 <syntax><literal>test</literal></syntax>
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 347
diff changeset
66 <syntax><literal>size</literal></syntax>
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 347
diff changeset
67 <syntax>
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 347
diff changeset
68 <literal>rotate</literal>
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 347
diff changeset
69 <literal>90</literal> | <literal>180</literal> |
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 347
diff changeset
70 <literal>270</literal></syntax>
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 347
diff changeset
71 <syntax>
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 347
diff changeset
72 <literal>resize</literal>
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 347
diff changeset
73 <value>width</value>
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 347
diff changeset
74 <value>height</value></syntax>
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 347
diff changeset
75 <syntax>
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 347
diff changeset
76 <literal>crop</literal>
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 347
diff changeset
77 <value>width</value>
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 347
diff changeset
78 <value>height</value></syntax>
683
6c14c73d74ee Documented default value of the image_filter directive.
Vladimir Homutov <vl@nginx.com>
parents: 589
diff changeset
79 <default>off</default>
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
80 <context>location</context>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
81
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
82 <para>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
83 Sets the type of transformation to perform on images:
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
84 <list type="tag">
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
85
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
86 <tag-name><literal>off</literal></tag-name>
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
87 <tag-desc>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
88 turns off module processing in a surrounding location.
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
89 </tag-desc>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
90
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
91 <tag-name><literal>test</literal></tag-name>
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
92 <tag-desc>
1830
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
93 ensures that responses are images in either JPEG, GIF, PNG, or WebP format.
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 873
diff changeset
94 Otherwise, the
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
95 <http-status code="415" text="Unsupported Media Type"/>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 873
diff changeset
96 error is returned.
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
97 </tag-desc>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
98
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
99 <tag-name><literal>size</literal></tag-name>
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
100 <tag-desc>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
101 outputs information about images in a JSON format, e.g.:
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
102 <example>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
103 { "img" : { "width": 100, "height": 100, "type": "gif" } }
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
104 </example>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 873
diff changeset
105 In case of an error, the output is as follows:
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
106 <example>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
107 {}
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
108 </example>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
109 </tag-desc>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
110
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
111 <tag-name><literal>rotate</literal>
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
112 <literal>90</literal>|<literal>180</literal>|<literal>270</literal>
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
113 </tag-name>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
114 <tag-desc>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
115 rotates images counter-clockwise by the specified number of degrees.
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 873
diff changeset
116 Parameter value can contain variables.
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 873
diff changeset
117 This mode can be used either alone or along with the
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
118 <literal>resize</literal> and <literal>crop</literal> transformations.
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
119 </tag-desc>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
120
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
121 <tag-name><literal>resize</literal>
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
122 <value>width</value>
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
123 <value>height</value>
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
124 </tag-name>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
125 <tag-desc>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
126 proportionally reduces an image to the specified sizes.
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
127 To reduce by only one dimension, another dimension can be specified as
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
128 “<literal>-</literal>”.
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
129 In case of an error, the server will return code
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
130 <http-status code="415" text="Unsupported Media Type"/>.
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 873
diff changeset
131 Parameter values can contain variables.
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
132 When used along with the <literal>rotate</literal> parameter,
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
133 the rotation happens <emphasis>after</emphasis> reduction.
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
134 </tag-desc>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
135
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
136 <tag-name><literal>crop</literal>
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
137 <value>width</value>
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
138 <value>height</value>
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
139 </tag-name>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
140 <tag-desc>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 873
diff changeset
141 proportionally reduces an image to the larger side size
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
142 and crops extraneous edges by another side.
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
143 To reduce by only one dimension, another dimension can be specified as
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
144 “<literal>-</literal>”.
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
145 In case of an error, the server will return code
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
146 <http-status code="415" text="Unsupported Media Type"/>.
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 873
diff changeset
147 Parameter values can contain variables.
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
148 When used along with the <literal>rotate</literal> parameter,
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
149 the rotation happens <emphasis>before</emphasis> reduction.
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
150 </tag-desc>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
151
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
152 </list>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
153 </para>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
154
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
155 </directive>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
156
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
157
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
158 <directive name="image_filter_buffer">
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
159 <syntax><value>size</value></syntax>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
160 <default>1M</default>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
161 <context>http</context>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
162 <context>server</context>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
163 <context>location</context>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
164
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
165 <para>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
166 Sets the maximum size of the buffer used for reading images.
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 873
diff changeset
167 When the size is exceeded the server returns error
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
168 <http-status code="415" text="Unsupported Media Type"/>.
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
169 </para>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
170
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
171 </directive>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
172
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
173
873
1e4f86ac3716 Documented the "image_filter_interlace" directive.
Homutov Vladimir <vl@nginx.com>
parents: 710
diff changeset
174 <directive name="image_filter_interlace">
1e4f86ac3716 Documented the "image_filter_interlace" directive.
Homutov Vladimir <vl@nginx.com>
parents: 710
diff changeset
175 <syntax><literal>on</literal> | <literal>off</literal></syntax>
1e4f86ac3716 Documented the "image_filter_interlace" directive.
Homutov Vladimir <vl@nginx.com>
parents: 710
diff changeset
176 <default>off</default>
1e4f86ac3716 Documented the "image_filter_interlace" directive.
Homutov Vladimir <vl@nginx.com>
parents: 710
diff changeset
177 <context>http</context>
1e4f86ac3716 Documented the "image_filter_interlace" directive.
Homutov Vladimir <vl@nginx.com>
parents: 710
diff changeset
178 <context>server</context>
1e4f86ac3716 Documented the "image_filter_interlace" directive.
Homutov Vladimir <vl@nginx.com>
parents: 710
diff changeset
179 <context>location</context>
1e4f86ac3716 Documented the "image_filter_interlace" directive.
Homutov Vladimir <vl@nginx.com>
parents: 710
diff changeset
180 <appeared-in>1.3.15</appeared-in>
1e4f86ac3716 Documented the "image_filter_interlace" directive.
Homutov Vladimir <vl@nginx.com>
parents: 710
diff changeset
181
1e4f86ac3716 Documented the "image_filter_interlace" directive.
Homutov Vladimir <vl@nginx.com>
parents: 710
diff changeset
182 <para>
1e4f86ac3716 Documented the "image_filter_interlace" directive.
Homutov Vladimir <vl@nginx.com>
parents: 710
diff changeset
183 If enabled, final images will be interlaced.
1e4f86ac3716 Documented the "image_filter_interlace" directive.
Homutov Vladimir <vl@nginx.com>
parents: 710
diff changeset
184 For JPEG, final images will be in “progressive JPEG” format.
1e4f86ac3716 Documented the "image_filter_interlace" directive.
Homutov Vladimir <vl@nginx.com>
parents: 710
diff changeset
185 </para>
1e4f86ac3716 Documented the "image_filter_interlace" directive.
Homutov Vladimir <vl@nginx.com>
parents: 710
diff changeset
186
1e4f86ac3716 Documented the "image_filter_interlace" directive.
Homutov Vladimir <vl@nginx.com>
parents: 710
diff changeset
187 </directive>
1e4f86ac3716 Documented the "image_filter_interlace" directive.
Homutov Vladimir <vl@nginx.com>
parents: 710
diff changeset
188
1e4f86ac3716 Documented the "image_filter_interlace" directive.
Homutov Vladimir <vl@nginx.com>
parents: 710
diff changeset
189
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
190 <directive name="image_filter_jpeg_quality">
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
191 <syntax><value>quality</value></syntax>
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
192 <default>75</default>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
193 <context>http</context>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
194 <context>server</context>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
195 <context>location</context>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
196
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
197 <para>
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
198 Sets the desired <value>quality</value> of the transformed JPEG images.
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 873
diff changeset
199 Acceptable values are in the range from 1 to 100.
205
f743d1f4683a Fixed wording.
Ruslan Ermilov <ru@nginx.com>
parents: 204
diff changeset
200 Lesser values usually imply both lower image quality and less data to transfer.
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
201 The maximum recommended value is 95.
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 873
diff changeset
202 Parameter value can contain variables.
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
203 </para>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
205 </directive>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
206
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
207
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
208 <directive name="image_filter_sharpen">
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
209 <syntax><value>percent</value></syntax>
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
210 <default>0</default>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
211 <context>http</context>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
212 <context>server</context>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
213 <context>location</context>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
214
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
215 <para>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
216 Increases sharpness of the final image.
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
217 The sharpness percentage can exceed 100.
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 873
diff changeset
218 The zero value disables sharpening.
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 873
diff changeset
219 Parameter value can contain variables.
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
220 </para>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
221
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
222 </directive>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
223
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
224
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
225 <directive name="image_filter_transparency">
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
226 <syntax><literal>on</literal>|<literal>off</literal></syntax>
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
227 <default>on</default>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
228 <context>http</context>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
229 <context>server</context>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
230 <context>location</context>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
231
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
232 <para>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
233 Defines whether transparency should be preserved when transforming
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 873
diff changeset
234 GIF images or PNG images with colors specified by a palette.
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 873
diff changeset
235 The loss of transparency results in images of a better quality.
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
236 The alpha channel transparency in PNG is always preserved.
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
237 </para>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
238
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
239 </directive>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
240
1830
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
241
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
242 <directive name="image_filter_webp_quality">
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
243 <syntax><value>quality</value></syntax>
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
244 <default>80</default>
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
245 <context>http</context>
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
246 <context>server</context>
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
247 <context>location</context>
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
248 <appeared-in>1.11.6</appeared-in>
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
249
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
250 <para>
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
251 Sets the desired <value>quality</value> of the transformed WebP images.
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
252 Acceptable values are in the range from 1 to 100.
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
253 Lesser values usually imply both lower image quality and less data to transfer.
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
254 Parameter value can contain variables.
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
255 </para>
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
256
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
257 </directive>
6ebdef43330a Added support for WebP to the image_filter module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
258
204
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
259 </section>
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
260
eed54ef19197 English translation of the ngx_http_image_filter_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
261 </module>