From 86c5645fca24977ae28dc4a0da61cefd3f6e723e Mon Sep 17 00:00:00 2001 From: dylan araps Date: Wed, 6 Jan 2016 12:49:21 +1100 Subject: [PATCH] Added filesize to thumbnail filename, this lets us remove the slow image size check and speeds up the script even more! --- fetch.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/fetch.sh b/fetch.sh index df84fe04..f2fe281f 100755 --- a/fetch.sh +++ b/fetch.sh @@ -670,13 +670,7 @@ getimage () { [ "$wall" == "on" ] && getwallpaper # Get name of image and prefix it with it's crop mode and offset - imgname="$crop_mode-$crop_offset-${img##*/}" - - # This check allows you to resize the image at launch - if [ -f "$imgtempdir/$imgname" ] && [ $imgheight != $imgsize ]; then - imgheight=$(identify -format "%h" "$imgtempdir/$imgname") - rm "$imgtempdir/$imgname" - fi + imgname="$crop_mode-$crop_offset-$imgsize-${img##*/}" # Check to see if the thumbnail exists before we do any cropping. if [ ! -f "$imgtempdir/$imgname" ]; then @@ -723,6 +717,7 @@ getimage () { "$img" \ -gravity $crop_offset \ -crop "$size"x"$size"+0+0 \ + -quality 95 \ -scale "$imgsize"x"$imgsize" \ "$imgtempdir/$imgname" ;;