Fix issue where w3m couldn't display an image without a file extension
This commit is contained in:
parent
10843ffabb
commit
4cd78d3148
11
fetch
11
fetch
|
@ -1054,8 +1054,19 @@ getimage () {
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 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
|
# Get name of image and prefix it with it's crop mode and offset
|
||||||
imgname="$crop_mode-$crop_offset-$imgsize-${img##*/}"
|
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.
|
# Check to see if the thumbnail exists before we do any cropping.
|
||||||
if [ ! -f "$imgtempdir/$imgname" ]; then
|
if [ ! -f "$imgtempdir/$imgname" ]; then
|
||||||
|
|
Reference in New Issue