add satanic ritual filter - annna - Annna the nice friendly bot. HTML git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/ DIR Log DIR Files DIR Refs DIR Tags DIR README --- DIR commit 701bf7bd28ad22910099a4ac3843d29d65736e46 DIR parent 80100bfa20a1e0fe5810149b8a578e92849c77cc HTML Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Wed, 21 Sep 2022 20:24:28 +0200 add satanic ritual filter Signed-off-by: Annna Robert-Houdin <annna@bitreich.org> Diffstat: M annna-message-common | 10 +++++----- A satanic-ritual | 34 +++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 5 deletions(-) --- DIR diff --git a/annna-message-common b/annna-message-common @@ -878,6 +878,7 @@ case "${text}" in "${ircuser}, please mow #"*|\ "${ircuser}, please putin #"*|\ "${ircuser}, please reverse #"*|\ +"${ircuser}, please ritual #"*|\ "${ircuser}, please science #"*|\ "${ircuser}, please scrollify #"*|\ "${ircuser}, please sendtohell #"*|\ @@ -909,11 +910,7 @@ case "${text}" in # outfile and outpath filtering for the cache. case "${filter}" in - antidepressant) - outfile="${outfile%.*}.jpg" - outpath="${outpath%.*}.jpg" - ;; - putin) + antidepressant|ritual|putin) outfile="${outfile%.*}.jpg" outpath="${outpath%.*}.jpg" ;; @@ -950,6 +947,9 @@ case "${text}" in antidepressant) antidepressant "${inpath}" "${outpath}" 2>&1 >/dev/null ;; + ritual) + satanic-ritual "${inpath}" "${outpath}" 2>&1 >/dev/null + ;; putin) putin-os "${inpath}" "${outpath}" 2>&1 >/dev/null ;; DIR diff --git a/satanic-ritual b/satanic-ritual @@ -0,0 +1,34 @@ +#!/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/ritual.jpg \ + \( "${in}" \ + -matte \ + -virtual-pixel transparent \ + -resize 140x140 \ + -shear -30x-4 \ + -rotate -5 \ + -transparent white \ + \) \ + -geometry +20+130 \ + -gravity center \ + -composite "$2"