From c2b3a157c4394d9c8717b78d8e96b771dcd6ae03 Mon Sep 17 00:00:00 2001 From: hkc Date: Tue, 1 Feb 2022 16:04:07 +0300 Subject: [PATCH] muck. --- src/image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/image.c b/src/image.c index 61ca07c..6a9f33b 100644 --- a/src/image.c +++ b/src/image.c @@ -47,7 +47,7 @@ void get_size_keep_aspect(int w, int h, int dw, int dh, int *ow, int *oh) { tmp_1 = floor(dh * ratio); tmp_2 = ceil(dh * ratio); - if (fabsf(ratio - (float)tmp_1 / dh) < fabsf(ratio - (float)tmp_w / dh)) + if (fabsf(ratio - (float)tmp_1 / dh) < fabsf(ratio - (float)tmp_2 / dh)) *ow = tmp_1 < 1 ? 1 : tmp_1; else *ow = tmp_2 < 1 ? 1 : tmp_2;