From 4edbbd349f994b69c0fed96cc775cfe8ed450422 Mon Sep 17 00:00:00 2001 From: dylan araps Date: Wed, 6 Jan 2016 10:50:37 +1100 Subject: [PATCH] Combine if statements and remove uneeded line from fill crop --- fetch.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fetch.sh b/fetch.sh index 3d8ac667..047de26b 100755 --- a/fetch.sh +++ b/fetch.sh @@ -666,9 +666,9 @@ getimage () { imgname="$crop_mode-$crop_offset-${img##*/}" # This check allows you to resize the image at launch - if [ -f "$imgtempdir/$imgname" ]; then + if [ -f "$imgtempdir/$imgname" ] && [ $imgheight != $imgsize ]; then imgheight=$(identify -format "%h" "$imgtempdir/$imgname") - [ $imgheight != $imgsize ] && rm "$imgtempdir/$imgname" + rm "$imgtempdir/$imgname" fi # Check to see if the thumbnail exists before we do any cropping. @@ -700,12 +700,10 @@ getimage () { ;; fill) - c=$(convert "$img" -colorspace srgb -format "%[pixel:p{0,0}]" info:) convert \ "$img" \ -trim +repage \ -scale "$imgsize"x"$imgsize"^ \ - -background "$c" \ -extent "$imgsize"x"$imgsize" \ "$imgtempdir/$imgname" ;;