From 1e774e4076cec4c9ea6695cabe4cb9580c4db7b1 Mon Sep 17 00:00:00 2001 From: pitchum Date: Sat, 9 Jan 2021 11:23:35 +0100 Subject: [PATCH] Save generated captchas in /var/lib/ejabberd/chapril_captchas/ This reverts commit 3276a09029764bd2f0e1de4f39d7daf605f51b51. --- captcha/captcha.sh | 9 +++++++++ captcha/experimental.sh | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/captcha/captcha.sh b/captcha/captcha.sh index c41b134..5406eb6 100755 --- a/captcha/captcha.sh +++ b/captcha/captcha.sh @@ -125,6 +125,15 @@ RAND_ANGLE=$(($R % 3)) get_random RAND_INDEX=$(($R % ${#TRANSFORMATIONS[@]})) +convert -size 300x60 xc:none -pointsize 20 \ + \( -clone 0 -fill black \ + -stroke black -strokewidth 1 \ + -annotate "${RAND_ANGLE}x${RAND_ITALIC}+0+0" "\n $(${TRANSFORMATIONS[$RAND_INDEX]})" \ + -roll +$ROLL_X+0 \ + -wave "$WAVE1_AMPLITUDE"x"$WAVE1_LENGTH" \ + -roll -$ROLL_X+0 \) \ + -flatten -crop 300x60 +repage -quality 500 -depth 11 png:"/var/lib/ejabberd/chapril_captchas/${INPUT}_$(date "+%Y-%m-%d-%H%M%S").png" + convert -size 300x60 xc:none -pointsize 20 \ \( -clone 0 -fill black \ -stroke black -strokewidth 1 \ diff --git a/captcha/experimental.sh b/captcha/experimental.sh index c41b134..9ae6d90 100755 --- a/captcha/experimental.sh +++ b/captcha/experimental.sh @@ -125,6 +125,15 @@ RAND_ANGLE=$(($R % 3)) get_random RAND_INDEX=$(($R % ${#TRANSFORMATIONS[@]})) +convert -size 300x60 xc:none -pointsize 20 \ + \( -clone 0 -fill black \ + -stroke black -strokewidth 1 \ + -annotate "${RAND_ANGLE}x${RAND_ITALIC}+0+0" "\n $(${TRANSFORMATIONS[$RAND_INDEX]})" \ + -roll +$ROLL_X+0 \ + -wave "$WAVE1_AMPLITUDE"x"$WAVE1_LENGTH" \ + -roll -$ROLL_X+0 \) \ + -flatten -crop 300x60 +repage -quality 500 -depth 11 png:"/var/lib/ejabberd/chapril_captchas/EXPERIMENTAL${INPUT}_$(date "+%Y-%m-%d-%H%M%S").png" + convert -size 300x60 xc:none -pointsize 20 \ \( -clone 0 -fill black \ -stroke black -strokewidth 1 \