antidepressant - annna - Annna the nice friendly bot. | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
antidepressant (473B) | |
--- | |
1 #!/bin/sh | |
2 | |
3 die() { | |
4 printf '%s\n' "$1" >&2 | |
5 exit 1 | |
6 } | |
7 | |
8 if test $# -ne 2; then | |
9 die "usage: ${0##*/} <file> <outimagefile>" | |
10 fi | |
11 | |
12 mimetype="$(file -ib "$1")" | |
13 case "$mimetype" in | |
14 video/*) | |
15 in="$(mktemp).jpg" | |
16 ffmpeg -i "$1" -frames:v 1 "$in";; | |
17 image/*) | |
18 in="$1";; | |
19 *) | |
20 die "file type '${mimetype}' not supported";; | |
21 esac | |
22 | |
23 magick convert /br/gopher/memecache/c++-anti-depressant.jpg \ | |
24 \( "${in}" -resize 200x100 \) \ | |
25 -gravity center -geometry -240+200 \ | |
26 -composite "$2" |