Welcome! Log In Create A New Profile

Advanced

[patch] ngx_http_image_filter_module crop offset

Maxim Bublis
April 27, 2012 06:14AM
Hello.

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
(current behavior).

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
else).
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
documentation too.

--
Maxim Bublis
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[patch] ngx_http_image_filter_module crop offset Attachments

Maxim Bublis 1667 April 27, 2012 06:14AM

how to check out nginx.org from svn (was Re: [patch] ngx_http_image_filter_module crop offset)

Maxim Konovalov 526 April 27, 2012 06:18AM

Re: how to check out nginx.org from svn (was Re: [patch] ngx_http_image_filter_module crop offset)

Maxim Bublis 660 April 27, 2012 06:28AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 314
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready