X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=images%2Fscale.c;h=2c351cbdcb6714d47e4a4f74a69bff680dbea3d3;hb=94022b1a1e317871b302946b595b2e890f4f1853;hp=4eceac678a7a91e42e3e2f4c088cc21a64753951;hpb=35d602a8f8676b8988eca13086c63f2026c1b952;p=libucw.git diff --git a/images/scale.c b/images/scale.c index 4eceac67..2c351cbd 100644 --- a/images/scale.c +++ b/images/scale.c @@ -74,7 +74,7 @@ image_dimensions_fit_to_box(u32 *cols, u32 *rows, u32 max_cols, u32 max_rows, un { if (!upsample) return; - if (max_cols / *cols > max_rows / *rows) + if (max_cols * *rows > max_rows * *cols) { *cols = *cols * max_rows / *rows; *cols = MIN(*cols, max_cols); @@ -100,5 +100,4 @@ down_rows: *rows = *rows * max_cols / *cols; *rows = MAX(*rows, 1); *cols = max_cols; - return; }