Nginx image_filter module with ability to add placement for cropped images.
C
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example
README.md
ngx_http_image_filter_module.c

README.md

nginx image_filter

This is basically the same image_filter module, but with ability to place cropped images.

Goals

Humans usually have faces at the top of their photos, but nginx always crop image to center. We needed to make it more flexible.

Configuration

This module has additional configuration option:

image_filter_crop_offset {left,center,right} {top,center,bottom};

Examples

Vertical images

  • Original image

Original vertical image

  • Crop and align to top: image_filter_crop_offset center top;

Aligned to top vertical image

  • Crop and align to center (original behavior): image_filter_crop_offset center center;

Aligned to center vertical image

  • Crop and align to bottom: image_filter_crop_offset center bottom;

Aligned to bottom vertical image

Horizontal images

  • Original image

Original horizontal image

  • Crop and align to left: image_filter_crop_offset left center;

Aligned to left horizontal image

  • Crop and align to center (original behavior): image_filter_crop_offset center center;

Aligned to center horizontal image

  • Crop and align to right: image_filter_crop_offset right center;

Aligned to right horizontal image

Authors