Specialist HTTP directives

image_filter (http-image-filter)

Image transformation directive; exact forms depend on operation and module availability.

Formal Syntax & Structure

nginx syntaxnginx
image_filter off | test | size; OR image_filter rotate angle; OR image_filter resize width height; OR image_filter crop width height;

Parameters & Attributes

NameTypeDescription
modeoff | test | size | rotate | resize | cropSelect operation. Module requires libgd and compatible build.
angle90 | 180 | 270 | supported expressionRequired only in rotate mode.
widthpositive dimension | - | supported expressionRequired for resize or crop; dash can leave one dimension unconstrained.
heightpositive dimension | - | supported expressionRequired for resize or crop; both dimension positions must be supplied.

Working Example

Example Snippetnginx
image_filter size;
Nginx Reference