Properly fallback to ascii mode if isn't a file
This commit is contained in:
parent
2d6e92440f
commit
f035196886
1 changed files with 8 additions and 5 deletions
13
fetch
13
fetch
|
@ -1519,11 +1519,17 @@ getimage () {
|
|||
esac
|
||||
|
||||
# If $img is empty, reset padding to 0 and exit the function
|
||||
if [ -z "$img" ]; then
|
||||
padding="\033[0C"
|
||||
if [ ! -f "$img" ]; then
|
||||
# Fallback to ascii mode
|
||||
image="ascii"
|
||||
getascii
|
||||
|
||||
return
|
||||
fi
|
||||
|
||||
# Lines equals terminal height
|
||||
lines=$(tput lines)
|
||||
|
||||
# Check to see if the image has a file extension
|
||||
case "${img##*/}" in
|
||||
*"."*)
|
||||
|
@ -1590,9 +1596,6 @@ getimage () {
|
|||
esac
|
||||
fi
|
||||
|
||||
# Lines equals terminal height
|
||||
lines=$(tput lines)
|
||||
|
||||
# The final image
|
||||
img="$imgtempdir/$imgname"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue