Welcome! Log In Create A New Profile

Advanced

[patch] ngx_http_image_filter_module incorrectly calculates size

Maxim Bublis
April 19, 2012 01:30PM
Hi.

There is a bug in ngx_http_image_resize function from
ngx_http_image_filter_module with incorrect calculation of new image
sizes after resizing with crop in case of original image is capable to
resize with preservation of original proportions (i.e. crop is not
required). For example, resizing image with original sizes of 360x203
to 304x171 with crop, will surprisingly give us resized and cropped
image with sizes of 303x171, though resizing the same image without
crop will give us correct image with sizes of 304x171.
Attached image_filter_crop.patch fixes this undesired behavior.

In the same time i've found that algorithm for calculation of new
image sizes in both resize and crop cases could be generalized.
Attached image_filter.patch uses this idea and reduces number of
duplicated source lines (also includes bugfix from
image_filter_crop.patch).

--
Maxim Bublis
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
SubjectAuthorViewsPosted

[patch] ngx_http_image_filter_module incorrectly calculates size Attachments

Maxim Bublis479April 19, 2012 01:30PM

Re: [patch] ngx_http_image_filter_module incorrectly calculates size

Maxim Dounin124April 20, 2012 05:34AM

Re: [patch] ngx_http_image_filter_module incorrectly calculates size

Maxim Bublis121April 20, 2012 07:26AM

Re: [patch] ngx_http_image_filter_module incorrectly calculates size

Maxim Dounin142April 20, 2012 08:50AM

Re: [patch] ngx_http_image_filter_module incorrectly calculates size

Maxim Bublis190April 20, 2012 09:34AM



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

Online Users

Guests: 62
Record Number of Users: 5 on May 22, 2013
Record Number of Guests: 150 on May 22, 2013
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready