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