Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r4602 - trunk/src/http/modules

Anonymous User
April 21, 2012 03:04PM
Author: mdounin
Date: 2012-04-21 19:02:21 +0000 (Sat, 21 Apr 2012)
New Revision: 4602
URL: http://trac.nginx.org/nginx/changeset/4602/nginx

Log:
Image filter: compare aspect ratio more accurately during crop.

Previously used fixed-point calculation caused wrong code path selection
in some cases, resulting in incorrect image size.

See here for report:
http://mailman.nginx.org/pipermail/nginx-devel/2012-April/002123.html


Modified:
trunk/src/http/modules/ngx_http_image_filter_module.c

Modified: trunk/src/http/modules/ngx_http_image_filter_module.c
===================================================================
--- trunk/src/http/modules/ngx_http_image_filter_module.c 2012-04-19 15:48:03 UTC (rev 4601)
+++ trunk/src/http/modules/ngx_http_image_filter_module.c 2012-04-21 19:02:21 UTC (rev 4602)
@@ -817,9 +817,7 @@

resize = 0;

- if ((ngx_uint_t) (dx * 100 / dy)
- < ctx->max_width * 100 / ctx->max_height)
- {
+ if ((double) dx / dy < (double) ctx->max_width / ctx->max_height) {
if ((ngx_uint_t) dx > ctx->max_width) {
dy = dy * ctx->max_width / dx;
dy = dy ? dy : 1;

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

[nginx] svn commit: r4602 - trunk/src/http/modules

Anonymous User563April 21, 2012 03:04PM



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

Online Users

Guests: 84
Record Number of Users: 3 on May 21, 2013
Record Number of Guests: 105 on May 21, 2013
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready