HttpImageFilterModuleJa

インストール | モジュール |  アドオン |  設定 |  コミュニティ |  その他の情報源 = 概要 =

Version: 0.7.54+

このモジュールは JPEG, GIF, PNG イメージを生成するためのフィルタです. これはデフォルトでは有効になりません. nginx ビルド時の ./configure オプションとして、次の設定を行う必要があります: --with-http_image_filter_module

このモジュールのビルド、実行には libgd が必須です. 最新の libgd を用いることを推奨します.

= 設定例 = location /img/ { proxy_pass    http://backend; image_filter  resize  150 100; error_page    415   = /empty; }

location = /empty { empty_gif; }

= Directives =

image_filter


Specifies the type of transformation to apply to the image, one of the below:


 * test: checking that the response is indeed an image format JPEG, GIF or PNG. Otherwise, an error 415.

{ "img" : { "width": 100, "height": 100, "type": "gif" } } Or if an error occurs, {}
 * size: Gives information about the image in JSON format. For example,


 * resize: proportionally reduces the image to a specified size.


 * crop: proportionally reduces the image to a specified size and trims extra edge.

image_filter_buffer


Sets the maximum size for reading the image.

image_filter_jpeg_quality


Sets the rate of loss of information when processing the images as JPEG. The maximum recommended value is 95.

image_filter_sharpen


image_filter_transparency


This directive allows you to disable image transparency in GIF and palette-based PNG to improve image resampling quality.

True color PNG alpha-channels are always preserved despite this setting.

Note: Grayscale PNG's are untested, but should be handled as truecolor PNGs.

= References = Original Documentation