Commit 288036eb authored by Dylan Araps's avatar Dylan Araps

misc: cleanup

parent aae32714
...@@ -3403,8 +3403,7 @@ get_ascii() { ...@@ -3403,8 +3403,7 @@ get_ascii() {
# Calculate size of ascii file in line length / line count. # Calculate size of ascii file in line length / line count.
while IFS=$'\n' read -r line; do while IFS=$'\n' read -r line; do
((${#line} > ascii_length)) && ascii_length="${#line}" ((++lines,${#line}>ascii_length)) && ascii_length="${#line}"
((++lines))
done <<< "${ascii_data//\$\{??\}}" done <<< "${ascii_data//\$\{??\}}"
# Colors. # Colors.
...@@ -3648,17 +3647,15 @@ get_image_size() { ...@@ -3648,17 +3647,15 @@ get_image_size() {
"none") "none")
# Get image size so that we can do a better crop. # Get image size so that we can do a better crop.
read -r width height <<< "$(identify -format "%w %h" "$image")" read -r width height <<< "$(identify -format "%w %h" "$image")"
crop_mode="none"
while ((width >= (term_width / 2) || height >= term_height)); do while ((width >= (term_width / 2) || height >= term_height)); do
((width=width/2)) ((width=width/2,height=height/2))
((height=height/2))
done done
;;
*) crop_mode="none"
image_size="${image_size/px}"
;; ;;
*) image_size="${image_size/px}" ;;
esac esac
width="${width:-$image_size}" width="${width:-$image_size}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment