From c43ffb028e83a0c855a453abed911b862e3d2532 Mon Sep 17 00:00:00 2001 From: dylan araps Date: Wed, 13 Dec 2017 10:29:14 +1100 Subject: [PATCH] image: Make (--size none) keep original image aspect ratio. --- neofetch | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/neofetch b/neofetch index a2db5711..e73f5dbf 100755 --- a/neofetch +++ b/neofetch @@ -2690,6 +2690,12 @@ get_image_size() { width="${size%% *}" height="${size##* }" crop_mode="none" + + while (( "$width" >= ("$term_width" / 2) || + "$height" >= "$term_height" )); do + width="$((width / 2))" + height="$((height / 2))" + done ;; *) image_size="${image_size/px}" ;;