diff options
Diffstat (limited to 'bin/image')
| -rw-r--r-- | bin/image/shellrc | 16 |
1 files changed, 16 insertions, 0 deletions
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 @@ | |||
| 2 | 2 | ||
| 3 | # Concatenate image vertically | 3 | # Concatenate image vertically |
| 4 | image.vertical() { | 4 | image.vertical() { |
| 5 | if [ ! $# = 0 ]; then | ||
| 6 | echo 'Usage: image.vertical input1.jpg input2.jpg' | ||
| 7 | return 0 | ||
| 8 | fi | ||
| 9 | |||
| 5 | ext=${1##*.} | 10 | ext=${1##*.} |
| 6 | convert "$@" -append $(basename -s .$ext $1)-$(basename -s .$ext ${@: -1}).${format:-$ext} | 11 | convert "$@" -append $(basename -s .$ext $1)-$(basename -s .$ext ${@: -1}).${format:-$ext} |
| 7 | } | 12 | } |
| 8 | 13 | ||
| 9 | # Concatenate image horizontally | 14 | # Concatenate image horizontally |
| 10 | image.horizontal() { | 15 | image.horizontal() { |
| 16 | if [ ! $# = 0 ]; then | ||
| 17 | echo 'Usage: image.horizontal input1.jpg input2.jpg' | ||
| 18 | return 0 | ||
| 19 | fi | ||
| 20 | |||
| 11 | ext=${1##*.} | 21 | ext=${1##*.} |
| 12 | convert "$@" +append output.$ext | 22 | convert "$@" +append output.$ext |
| 13 | } | 23 | } |
| @@ -21,7 +31,13 @@ image.from_data_url() { | |||
| 21 | 31 | ||
| 22 | # Resize image | 32 | # Resize image |
| 23 | image.resize() { | 33 | image.resize() { |
| 34 | if [ ! $# = 2 ]; then | ||
| 35 | echo 'Usage: image.resize INPUT.jpg 80%' | ||
| 36 | return 0 | ||
| 37 | fi | ||
| 38 | |||
| 24 | ext=${1##*.} | 39 | ext=${1##*.} |
| 40 | echo OUTPUT: output.$ext | ||
| 25 | convert -resize $2 $1 output.$ext | 41 | convert -resize $2 $1 output.$ext |
| 26 | } | 42 | } |
| 27 | 43 | ||