image: Simplify crop
This commit is contained in:
parent
6c238a03b2
commit
b628ec0f4d
1 changed files with 10 additions and 16 deletions
8
neofetch
8
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,8 +2705,6 @@ make_thumbnail() {
|
|||
mkdir -p "$thumbnail_dir"
|
||||
|
||||
if [[ ! -f "$thumbnail_dir/$image_name" ]]; then
|
||||
case "$image_size" in
|
||||
"square")
|
||||
convert \
|
||||
"$image" \
|
||||
-strip \
|
||||
|
@ -2716,10 +2714,6 @@ make_thumbnail() {
|
|||
-sample "$width"x"$height"^ \
|
||||
-extent "$width"x"$height" \
|
||||
"$thumbnail_dir/$image_name"
|
||||
;;
|
||||
|
||||
*) cp "$image" "$thumbnail_dir/$image_name" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
image="$thumbnail_dir/$image_name"
|
||||
|
|
Loading…
Reference in a new issue