Nginx Module Reference Manual: Image filter Module (image filter)

Source: Internet
Author: User
Keywords Nginx image filter Module
Tags aliyun can make compile default default value file html http

If you want to use these modules, you must specify the relevant compilation parameters at compile time.

This module can make changes to a picture file (http://www.aliyun.com/zixun/aggregation/16701.html ">jpeg, GIF, and PNG") when it is passed.
To use this module, you must specify the following compilation parameters at compile time (0.7.54 version available):

--with-http_image_filter_module

This module relies on LIBGD and recommends the use of recent versions.
Sample configuration:

location/img/{proxy_pass http://backend; image_filter resize error_page = 415;}/empty = location {/empty GIF;

Instructions

Image_filter

Syntax: Image_filter (test|size|resize width height|crop width height)
Default value: None
Working with Fields: location
Specifies the type that needs to be changed. Follows:

Test: Verify that the answer is a picture format, or return a 415 error. Size:json format picture information, such as: {"img": {"width": "," height ":", "type": "GIF"}}

Maybe it's a mistake:

{} Resize: Reduce the picture to the specified size. Crop: Reduce the picture to the specified size and crop the parts that are larger than the size.

Image_filter_buffer

Syntax: Image_filter_buffer size
Default value: 1M
Working with fields: HTTP, server, location
Reads the maximum value of a picture.

Image_filter_jpeg_quality

Syntax: image_filter_jpeg_quality [0 ... 100]
Default value: 75
Working with fields: HTTP, server, location
Set the quality ratio of the loss when processing JPEG pictures, with a maximum recommended value of 95.

Image_filter_transparency

Syntax: Image_filter_transparency on|off
Default value: On
Working with fields: HTTP, server, location
This directive allows you to disable image transparency in GIF and palette-based PNG to improve image quality.
True Color PNG's alpha channel always exists, regardless of whether this parameter is set.
Note: Grayscale PNG is not tested and will be processed as true color.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.