image: Make (--size none) keep original image aspect ratio.

This commit is contained in:
dylan araps 2017-12-13 10:29:14 +11:00
parent 8540a2f1e3
commit c43ffb028e
1 changed files with 6 additions and 0 deletions

View File

@ -2690,6 +2690,12 @@ get_image_size() {
width="${size%% *}" width="${size%% *}"
height="${size##* }" height="${size##* }"
crop_mode="none" crop_mode="none"
while (( "$width" >= ("$term_width" / 2) ||
"$height" >= "$term_height" )); do
width="$((width / 2))"
height="$((height / 2))"
done
;; ;;
*) image_size="${image_size/px}" ;; *) image_size="${image_size/px}" ;;