mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-10-04 17:09:21 +00:00
Combine if statements and remove uneeded line from fill crop
This commit is contained in:
6
fetch.sh
6
fetch.sh
@@ -666,9 +666,9 @@ getimage () {
|
|||||||
imgname="$crop_mode-$crop_offset-${img##*/}"
|
imgname="$crop_mode-$crop_offset-${img##*/}"
|
||||||
|
|
||||||
# This check allows you to resize the image at launch
|
# 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=$(identify -format "%h" "$imgtempdir/$imgname")
|
||||||
[ $imgheight != $imgsize ] && rm "$imgtempdir/$imgname"
|
rm "$imgtempdir/$imgname"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check to see if the thumbnail exists before we do any cropping.
|
# Check to see if the thumbnail exists before we do any cropping.
|
||||||
@@ -700,12 +700,10 @@ getimage () {
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
fill)
|
fill)
|
||||||
c=$(convert "$img" -colorspace srgb -format "%[pixel:p{0,0}]" info:)
|
|
||||||
convert \
|
convert \
|
||||||
"$img" \
|
"$img" \
|
||||||
-trim +repage \
|
-trim +repage \
|
||||||
-scale "$imgsize"x"$imgsize"^ \
|
-scale "$imgsize"x"$imgsize"^ \
|
||||||
-background "$c" \
|
|
||||||
-extent "$imgsize"x"$imgsize" \
|
-extent "$imgsize"x"$imgsize" \
|
||||||
"$imgtempdir/$imgname"
|
"$imgtempdir/$imgname"
|
||||||
;;
|
;;
|
||||||
|
Reference in New Issue
Block a user