luk4hn / nginx_image_filter

Nginx image_filter module with ability to add placement for cropped images.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Nginx image_filter module with ability to add placement for cropped images.