diff options
-rw-r--r-- | bin/image/shellrc | 16 |
1 files 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 @@ | |||
1 | # Image Utilities | 1 | # Image Utilities |
2 | 2 | ||
3 | # Concatenate image vertically | 3 | # Concatenate image vertically |
4 | image.vertical() { | 4 | image.vertical() { |
5 | suffix=${1##*.} | 5 | ext=${1##*.} |
6 | convert "$@" -append $(basename -s .$suffix $1)-$(basename -s .$suffix ${@: -1}).${format:-$suffix} | 6 | convert "$@" -append $(basename -s .$ext $1)-$(basename -s .$ext ${@: -1}).${format:-$ext} |
7 | } | 7 | } |
8 | 8 | ||
9 | # Concatenate image horizontally | 9 | # Concatenate image horizontally |
10 | image.horizontal() { | 10 | image.horizontal() { |
11 | ext=${1##*.} | 11 | ext=${1##*.} |
12 | convert "$@" +append output.$ext | 12 | convert "$@" +append output.$ext |
13 | } | 13 | } |
@@ -19,6 +19,12 @@ image.from_data_url() { | |||
19 | identify $1 | 19 | identify $1 |
20 | } | 20 | } |
21 | 21 | ||
22 | # Resize image | ||
23 | image.resize() { | ||
24 | ext=${1##*.} | ||
25 | convert -resize $2 $1 output.$ext | ||
26 | } | ||
27 | |||
22 | # Upload image to vps | 28 | # Upload image to vps |
23 | # Usage: | 29 | # Usage: |
24 | # image.upload foo.png | 30 | # image.upload foo.png |