Combine if statements and remove uneeded line from fill crop
This commit is contained in:
parent
fe86db3b74
commit
4edbbd349f
1 changed files with 2 additions and 4 deletions
6
fetch.sh
6
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"
|
||||
;;
|
||||
|
|
Loading…
Reference in a new issue