From 38267aff9fdc933c814aff11bd3aae7eebe59072 Mon Sep 17 00:00:00 2001 From: alpine9000 Date: Mon, 21 Mar 2016 21:16:51 +1100 Subject: [PATCH] Correct fix for aspect ratio finder --- tools/resize/resize.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/resize/resize.c b/tools/resize/resize.c index c3990d7..3246f67 100644 --- a/tools/resize/resize.c +++ b/tools/resize/resize.c @@ -163,14 +163,15 @@ main(int argc, char **argv) int newHeight = config.height; if (config.verbose) { - printf("width = %d, height = %d = %f\n", width, height, (float)width/(float)height); - printf("config.width = %d, config.height = %d = %f\n", config.width, config.height, configRatio); + printf("width = %d, height = %d ratio = %f\n", width, height, (float)width/(float)height); + printf("config.width = %d, config.height = %d configRatio = %f\n", config.width, config.height, configRatio); } + float ratio = (float)width/(float)height; wScale = (float)height/(float)config.height; hScale = (float)width/(float)config.width; - if (width > height && wScale >= configRatio) { + if (ratio >= configRatio) { newWidth = width/wScale; } else {