From a63fda46e8905fa7c3082a19d2bfbe02a9827c93 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Mon, 12 Jun 2023 10:15:11 +0800 Subject: Update --- bin/image/shellrc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'bin/image') diff --git a/bin/image/shellrc b/bin/image/shellrc index fbb2c20..81e029b 100644 --- a/bin/image/shellrc +++ b/bin/image/shellrc @@ -2,12 +2,22 @@ # Concatenate image vertically image.vertical() { + if [ ! $# = 0 ]; then + echo 'Usage: image.vertical input1.jpg input2.jpg' + return 0 + fi + ext=${1##*.} convert "$@" -append $(basename -s .$ext $1)-$(basename -s .$ext ${@: -1}).${format:-$ext} } # Concatenate image horizontally image.horizontal() { + if [ ! $# = 0 ]; then + echo 'Usage: image.horizontal input1.jpg input2.jpg' + return 0 + fi + ext=${1##*.} convert "$@" +append output.$ext } @@ -21,7 +31,13 @@ image.from_data_url() { # Resize image image.resize() { + if [ ! $# = 2 ]; then + echo 'Usage: image.resize INPUT.jpg 80%' + return 0 + fi + ext=${1##*.} + echo OUTPUT: output.$ext convert -resize $2 $1 output.$ext } -- cgit v1.2.3-70-g09d2