From b628ec0f4deeadab14ce595d4db3f46193c9b9d1 Mon Sep 17 00:00:00 2001 From: dylan araps Date: Thu, 14 Dec 2017 10:22:23 +1100 Subject: [PATCH] image: Simplify crop --- neofetch | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/neofetch b/neofetch index a91dc687..eeeee833 100755 --- a/neofetch +++ b/neofetch @@ -2692,7 +2692,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-${image##*/}" + image_name="$image_size-$crop_offset-$width-$height-${image##*/}" # Handle file extensions. case "${image##*.}" in @@ -2705,21 +2705,15 @@ make_thumbnail() { mkdir -p "$thumbnail_dir" if [[ ! -f "$thumbnail_dir/$image_name" ]]; then - case "$image_size" in - "square") - convert \ - "$image" \ - -strip \ - -quality 50 \ - -gravity "$crop_offset" \ - -background none \ - -sample "$width"x"$height"^ \ - -extent "$width"x"$height" \ - "$thumbnail_dir/$image_name" - ;; - - *) cp "$image" "$thumbnail_dir/$image_name" ;; - esac + convert \ + "$image" \ + -strip \ + -quality 50 \ + -gravity "$crop_offset" \ + -background none \ + -sample "$width"x"$height"^ \ + -extent "$width"x"$height" \ + "$thumbnail_dir/$image_name" fi image="$thumbnail_dir/$image_name"