Fix issue where w3m couldn't display an image without a file extension

This commit is contained in:
Dylan 2016-01-24 11:17:48 +11:00
parent 10843ffabb
commit 4cd78d3148
1 changed files with 13 additions and 2 deletions

15
fetch
View File

@ -1054,8 +1054,19 @@ getimage () {
return
fi
# Get name of image and prefix it with it's crop mode and offset
imgname="$crop_mode-$crop_offset-$imgsize-${img##*/}"
# Check to see if the image has a file extension
case "${img##*/}" in
*"."*)
# Get name of image and prefix it with it's crop mode and offset
imgname="$crop_mode-$crop_offset-$imgsize-${img##*/}"
;;
*)
# Add a file extension if the image doesn't have one. This
# fixes w3m not being able to display them.
imgname="$crop_mode-$crop_offset-$imgsize-${img##*/}.jpg"
;;
esac
# Check to see if the thumbnail exists before we do any cropping.
if [ ! -f "$imgtempdir/$imgname" ]; then