From 8e9ac063a95cd32c2eb3ad7f8c89be6c4316a1c5 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Tue, 23 May 2023 08:13:30 +0800 Subject: Update --- bin/image/shellrc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/bin/image/shellrc b/bin/image/shellrc index e27b485..fbb2c20 100644 --- a/bin/image/shellrc +++ b/bin/image/shellrc @@ -1,13 +1,13 @@ # Image Utilities -# Concatenate image vertically -image.vertical() { - suffix=${1##*.} - convert "$@" -append $(basename -s .$suffix $1)-$(basename -s .$suffix ${@: -1}).${format:-$suffix} +# Concatenate image vertically +image.vertical() { + ext=${1##*.} + convert "$@" -append $(basename -s .$ext $1)-$(basename -s .$ext ${@: -1}).${format:-$ext} } # Concatenate image horizontally -image.horizontal() { +image.horizontal() { ext=${1##*.} convert "$@" +append output.$ext } @@ -19,6 +19,12 @@ image.from_data_url() { identify $1 } +# Resize image +image.resize() { + ext=${1##*.} + convert -resize $2 $1 output.$ext +} + # Upload image to vps # Usage: # image.upload foo.png -- cgit v1.2.3-70-g09d2