Changeset 4601:084137d883ec in nginx


Ignore:
Timestamp:
04/21/12 19:02:21 (4 years ago)
Author:
Maxim Dounin <mdounin@…>
Branch:
default
Convert:
svn:c3fe7df1-7212-e011-8a91-001109144009/trunk@4602
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/http/modules/ngx_http_image_filter_module.c

    r4412 r4601  
    818818        resize = 0;
    819819
    820         if ((ngx_uint_t) (dx * 100 / dy)
    821             < ctx->max_width * 100 / ctx->max_height)
    822         {
     820        if ((double) dx / dy < (double) ctx->max_width / ctx->max_height) {
    823821            if ((ngx_uint_t) dx > ctx->max_width) {
    824822                dy = dy * ctx->max_width / dx;
Note: See TracChangeset for help on using the changeset viewer.