Properly fallback to ascii mode if isn't a file

This commit is contained in:
Dylan 2016-01-30 17:55:31 +11:00
parent 2d6e92440f
commit f035196886

13
fetch
View file

@ -1519,11 +1519,17 @@ getimage () {
esac esac
# If $img is empty, reset padding to 0 and exit the function # If $img is empty, reset padding to 0 and exit the function
if [ -z "$img" ]; then if [ ! -f "$img" ]; then
padding="\033[0C" # Fallback to ascii mode
image="ascii"
getascii
return return
fi fi
# Lines equals terminal height
lines=$(tput lines)
# Check to see if the image has a file extension # Check to see if the image has a file extension
case "${img##*/}" in case "${img##*/}" in
*"."*) *"."*)
@ -1590,9 +1596,6 @@ getimage () {
esac esac
fi fi
# Lines equals terminal height
lines=$(tput lines)
# The final image # The final image
img="$imgtempdir/$imgname" img="$imgtempdir/$imgname"
} }