Mercurial > hg > nginx-site
changeset 1830:6ebdef43330a
Added support for WebP to the image_filter module.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Tue, 25 Oct 2016 19:52:33 +0300 |
parents | 5b2bdd96b4e1 |
children | b5e416ace4bf |
files | xml/en/docs/http/ngx_http_image_filter_module.xml xml/ru/docs/http/ngx_http_image_filter_module.xml |
diffstat | 2 files changed, 54 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/xml/en/docs/http/ngx_http_image_filter_module.xml Tue Oct 25 12:58:53 2016 +0000 +++ b/xml/en/docs/http/ngx_http_image_filter_module.xml Tue Oct 25 19:52:33 2016 +0300 @@ -10,13 +10,13 @@ <module name="Module ngx_http_image_filter_module" link="/en/docs/http/ngx_http_image_filter_module.html" lang="en" - rev="3"> + rev="4"> <section id="summary"> <para> The <literal>ngx_http_image_filter_module</literal> module (0.7.54+) is a filter -that transforms images in JPEG, GIF, and PNG formats. +that transforms images in JPEG, GIF, PNG, and WebP formats. </para> <para> @@ -28,6 +28,11 @@ <link url="http://libgd.org">libgd</link> library. It is recommended to use the latest available version of the library. </note> +<note> +The WebP format support appeared in version 1.11.6. +To transform images in this format, +the <literal>libgd</literal> library must be compiled with the WebP support. +</note> </para> </section> @@ -85,7 +90,7 @@ <tag-name><literal>test</literal></tag-name> <tag-desc> -ensures that responses are images in either JPEG, GIF, or PNG format. +ensures that responses are images in either JPEG, GIF, PNG, or WebP format. Otherwise, the <http-status code="415" text="Unsupported Media Type"/> error is returned. @@ -233,6 +238,24 @@ </directive> + +<directive name="image_filter_webp_quality"> +<syntax><value>quality</value></syntax> +<default>80</default> +<context>http</context> +<context>server</context> +<context>location</context> +<appeared-in>1.11.6</appeared-in> + +<para> +Sets the desired <value>quality</value> of the transformed WebP images. +Acceptable values are in the range from 1 to 100. +Lesser values usually imply both lower image quality and less data to transfer. +Parameter value can contain variables. +</para> + +</directive> + </section> </module>
--- a/xml/ru/docs/http/ngx_http_image_filter_module.xml Tue Oct 25 12:58:53 2016 +0000 +++ b/xml/ru/docs/http/ngx_http_image_filter_module.xml Tue Oct 25 19:52:33 2016 +0300 @@ -10,13 +10,13 @@ <module name="Модуль ngx_http_image_filter_module" link="/ru/docs/http/ngx_http_image_filter_module.html" lang="ru" - rev="3"> + rev="4"> <section id="summary"> <para> Модуль <literal>ngx_http_image_filter_module</literal> (0.7.54+) — это фильтр -для преобразования изображений в форматах JPEG, GIF и PNG. +для преобразования изображений в форматах JPEG, GIF, PNG и WebP. </para> <para> @@ -28,6 +28,11 @@ <link url="http://libgd.org">libgd</link>. Рекомендуется использовать самую последнюю версию библиотеки. </note> +<note> +Поддержка формата WebP появилась в версии 1.11.6. +Для преобразования изображений в данном формате +библиотека <literal>libgd</literal> должна быть собрана с поддержкой WebP. +</note> </para> </section> @@ -86,7 +91,7 @@ <tag-name><literal>test</literal></tag-name> <tag-desc> проверяет, что ответ действительно является изображением -в формате JPEG, GIF или PNG. +в формате JPEG, GIF, PNG или WebP. В противном случае возвращается ошибка <http-status code="415" text="Unsupported Media Type"/>. </tag-desc> @@ -237,6 +242,26 @@ </directive> + +<directive name="image_filter_webp_quality"> +<syntax><value>качество</value></syntax> +<default>80</default> +<context>http</context> +<context>server</context> +<context>location</context> +<appeared-in>1.11.6</appeared-in> + +<para> +Задаёт желаемое <value>качество</value> преобразованного изображения +в формате WebP. +Допустимые значения находятся в диапазоне от 1 до 100. +Меньшим значениям обычно соответствует худшее качество изображения +и меньший объём передаваемых данных. +В значении параметра допустимо использование переменных. +</para> + +</directive> + </section> </module>