comparison src/http/modules/ngx_http_image_filter_module.c @ 672:f41d4b305d22 NGINX_1_2_0

nginx 1.2.0 *) Bugfix: a segmentation fault might occur in a worker process if the "try_files" directive was used; the bug had appeared in 1.1.19. *) Bugfix: response might be truncated if there were more than IOV_MAX buffers used. *) Bugfix: in the "crop" parameter of the "image_filter" directive. Thanks to Maxim Bublis.
author Igor Sysoev <http://sysoev.ru>
date Mon, 23 Apr 2012 00:00:00 +0400
parents d0f7a625f27c
children 88a1b4797f2e
comparison
equal deleted inserted replaced
671:47cb3497fbab 672:f41d4b305d22
815 815
816 } else { /* NGX_HTTP_IMAGE_CROP */ 816 } else { /* NGX_HTTP_IMAGE_CROP */
817 817
818 resize = 0; 818 resize = 0;
819 819
820 if ((ngx_uint_t) (dx * 100 / dy) 820 if ((double) dx / dy < (double) ctx->max_width / ctx->max_height) {
821 < ctx->max_width * 100 / ctx->max_height)
822 {
823 if ((ngx_uint_t) dx > ctx->max_width) { 821 if ((ngx_uint_t) dx > ctx->max_width) {
824 dy = dy * ctx->max_width / dx; 822 dy = dy * ctx->max_width / dx;
825 dy = dy ? dy : 1; 823 dy = dy ? dy : 1;
826 dx = ctx->max_width; 824 dx = ctx->max_width;
827 resize = 1; 825 resize = 1;