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
|
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"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue