[patch] ngx_http_image_filter_module crop offset
b at codemonkey.ru
Fri Apr 27 10:13:08 UTC 2012
I assume it is a very common (but not solved yet) problem to tell
image_filter's crop about it's alignment.
In case we want to resize portrait images with crop (for example from
480x640 to 200x200) it is really usefull to align it on top of image
instead of aligning it in the middle and cutting out part of face
There is a proposal to add image_filter_crop_offset setting with two
variables - axis x percentage offset and axis y percentage offset
(maybe it should be better called "percentage ratio" or something
image_filter_crop_offset <crop_x_offset> <crop_y_offset>;
The default and backward compatible values for both crop_x_offset and
crop_y_offset are 50. Valid values for both variables should be
between 0 and 100.
To solve problem with cropping portrait images we could simply do the
following setting - image_filter_crop_offset 50 10. It should tell
image_filter to crop 10% upside and 90% from downside.
Attached patch implements this proposal and adds support for crop offset.
Unfortunately, I have not found the way to checkout nginx_org
repository, but i'm ready to provide patch for Russian and English
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 6733 bytes
Desc: not available
More information about the nginx-devel