From 6cc08b5477ae4acf15968d01b998ce251a11459e Mon Sep 17 00:00:00 2001 From: dylan araps Date: Fri, 28 Jul 2017 21:54:58 +1000 Subject: [PATCH] image: Add support for all image formats that imagemagick supports. --- neofetch | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/neofetch b/neofetch index de136738..feaa0997 100755 --- a/neofetch +++ b/neofetch @@ -2277,7 +2277,7 @@ get_image_source() { if [[ -d "$image_source" ]]; then shopt -s nullglob - files=("${image_source%/}"/*.{png,jpg,jpeg,jpe,gif}) + files=("${image_source%/}"/*.{png,jpg,jpeg,jpe,gif,svg}) shopt -u nullglob image="${files[RANDOM % ${#files[@]}]}" @@ -2497,14 +2497,7 @@ get_image_size() { make_thumbnail() { # Name the thumbnail using variables so we can # use it later. - image_name="$crop_mode-$crop_offset-$width-$height" - - # Check to see if the image has a file extension, - # if it doesn't then add one. - case "${image##*/}" in - *"."*) image_name="${image_name}-${image##*/}" ;; - *) image_name="${image_name}-${image##*/}.jpg" ;; - esac + image_name="$crop_mode-$crop_offset-$width-$height-${image//\//_}.jpg" # Create the thumbnail dir if it doesn't exist. mkdir -p "$thumbnail_dir"