diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/emile/emile_image.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/lib/emile/emile_image.c b/src/lib/emile/emile_image.c index 55ad99de43..99a21b7145 100644 --- a/src/lib/emile/emile_image.c +++ b/src/lib/emile/emile_image.c | |||
@@ -1441,23 +1441,15 @@ _emile_jpeg_head(Emile_Image *image, | |||
1441 | opts->h = load_opts_w; | 1441 | opts->h = load_opts_w; |
1442 | } | 1442 | } |
1443 | 1443 | ||
1444 | if (opts->w > 0) | 1444 | w2 = opts->w; |
1445 | { | 1445 | h2 = (opts->w * prop->h) / prop->w; |
1446 | w2 = opts->w; | 1446 | if (h2 > opts->h) |
1447 | h2 = (opts->w * prop->h) / prop->w; | ||
1448 | if ((opts->h > 0) && (h2 > opts->h)) | ||
1449 | { | ||
1450 | unsigned int w3; | ||
1451 | h2 = opts->h; | ||
1452 | w3 = (opts->h * prop->w) / prop->h; | ||
1453 | if (w3 > w2) | ||
1454 | w2 = w3; | ||
1455 | } | ||
1456 | } | ||
1457 | else if (opts->h > 0) | ||
1458 | { | 1447 | { |
1448 | unsigned int w3; | ||
1459 | h2 = opts->h; | 1449 | h2 = opts->h; |
1460 | w2 = (opts->h * prop->w) / prop->h; | 1450 | w3 = (opts->h * prop->w) / prop->h; |
1451 | if (w3 > w2) | ||
1452 | w2 = w3; | ||
1461 | } | 1453 | } |
1462 | prop->w = w2; | 1454 | prop->w = w2; |
1463 | prop->h = h2; | 1455 | prop->h = h2; |