add putin filter - annna - Annna the nice friendly bot. | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit 6048db1f9eeb03f8e604bc144437caf2e92ee367 | |
parent 276503e74025524acb118ef563c24a643ed0ed86 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Sat, 5 Mar 2022 19:01:11 +0100 | |
add putin filter | |
Signed-off-by: Annna Robert-Houdin <[email protected]> | |
Diffstat: | |
M annna-message-common | 6 ++++++ | |
A putin-os | 32 +++++++++++++++++++++++++++++… | |
2 files changed, 38 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/annna-message-common b/annna-message-common | |
@@ -817,6 +817,7 @@ case "${text}" in | |
"${botname}, please doomify #"*|\ | |
"${botname}, please loop #"*|\ | |
"${botname}, please mow #"*|\ | |
+"${botname}, please putin #"*|\ | |
"${botname}, please reverse #"*|\ | |
"${botname}, please science #"*|\ | |
"${botname}, please scrollify #"*|\ | |
@@ -852,6 +853,11 @@ case "${text}" in | |
outpath="${outpath%.*}.jpg" | |
antidepressant "${inpath}" "${outpath}" 2>&1 >… | |
;; | |
+ putin) | |
+ outfile="${outfile%.*}.jpg" | |
+ outpath="${outpath%.*}.jpg" | |
+ putin-os "${inpath}" "${outpath}" 2>&1 >/dev/n… | |
+ ;; | |
*) | |
ffmpeg-effect "${filter}" "${inpath}" "${outpa… | |
;; | |
diff --git a/putin-os b/putin-os | |
@@ -0,0 +1,32 @@ | |
+#!/bin/sh | |
+ | |
+die() { | |
+ printf '%s\n' "$1" >&2 | |
+ exit 1 | |
+} | |
+ | |
+if test $# -ne 2; then | |
+ die "usage: ${0##*/} <file> <outimagefile>" | |
+fi | |
+ | |
+mimetype="$(file -ib "$1")" | |
+case "$mimetype" in | |
+ video/*) | |
+ in="$(mktemp).jpg" | |
+ ffmpeg -i "$1" -frames:v 1 "$in";; | |
+ image/*) | |
+ in="$1";; | |
+ *) | |
+ die "file type '${mimetype}' not supported";; | |
+esac | |
+ | |
+convert /home/annna/bin/modules/filter-media/putin-computing.png \ | |
+ \( "${in}" \ | |
+ -matte \ | |
+ -virtual-pixel transparent \ | |
+ -resize 150x150 \ | |
+ -shear 5x-4 \ | |
+ \) \ | |
+ -geometry +485-35 \ | |
+ -gravity center \ | |
+ -composite "$2" |