From 481704d43a924f903f6ce7aec1992603d5bd86c0 Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Thu, 14 Jan 2021 18:55:18 +0100 Subject: [PATCH] Captcha : changed size to make text to fit inside --- captcha/captcha.sh | 20 ++++++++++---------- captcha/experimental.sh | 16 ++++++++-------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/captcha/captcha.sh b/captcha/captcha.sh index 2b1921a..853afc0 100755 --- a/captcha/captcha.sh +++ b/captcha/captcha.sh @@ -112,24 +112,24 @@ INSTRUCTIONS=$(echo "$(${TRANSFORMATIONS[$RAND_INDEX]})" | cut -d "|" -f 1) INSTRUCTIONS2=$(echo "$(${TRANSFORMATIONS[$RAND_INDEX]})" | cut -d "|" -f 3) TEXT=$(echo "$(${TRANSFORMATIONS[$RAND_INDEX]})" | cut -d "|" -f 2) -convert -size 300x60 xc:none -pointsize 20 \ +convert -size 300x70 xc:none -pointsize 20 \ \( -clone 0 -fill black \ -stroke black -strokewidth 1 \ - -font Helvetica-Narrow -weight Thin -annotate "0x0+0+0" "\n $INSTRUCTIONS" \ - -font Helvetica-Bold -weight Light -annotate "0x0+0+18" "\n $TEXT" \ - -font Helvetica-Narrow -weight Thin -annotate "0x0+0+35" "\n $INSTRUCTIONS2" \ + -font Helvetica-Narrow -annotate "0x0+0+0" "\n $INSTRUCTIONS" \ + -font Helvetica-Bold -annotate "0x0+0+20" "\n $TEXT" \ + -font Helvetica-Narrow -annotate "0x0+0+40" "\n $INSTRUCTIONS2" \ -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/$(date "+%Y-%m-%d-%H%M%S")_${INPUT}.png" + -flatten -crop 300x70 +repage -quality 500 -depth 11 png:"/var/lib/ejabberd/chapril_captchas/$(date "+%Y-%m-%d-%H%M%S")_${INPUT}.png" -convert -size 300x60 xc:none -pointsize 20 \ +convert -size 300x70 xc:none -pointsize 20 \ \( -clone 0 -fill black \ -stroke black -strokewidth 1 \ - -font Helvetica-Narrow -weight Thin -annotate "0x0+0+0" "\n $INSTRUCTIONS" \ - -font Helvetica-Bold -annotate "0x0+0+18" "\n $TEXT" \ - -font Helvetica-Narrow -weight Thin -annotate "0x0+0+36" "\n $INSTRUCTIONS2" \ + -font Helvetica-Narrow -annotate "0x0+0+0" "\n $INSTRUCTIONS" \ + -font Helvetica-Bold -annotate "0x0+0+20" "\n $TEXT" \ + -font Helvetica-Narrow -annotate "0x0+0+40" "\n $INSTRUCTIONS2" \ -roll +$ROLL_X+0 \ -wave "$WAVE1_AMPLITUDE"x"$WAVE1_LENGTH" \ -roll -$ROLL_X+0 \) \ - -flatten -crop 300x60 +repage -quality 500 -depth 11 png:- + -flatten -crop 300x70 +repage -quality 500 -depth 11 png:- diff --git a/captcha/experimental.sh b/captcha/experimental.sh index ada5fad..c2cb51a 100755 --- a/captcha/experimental.sh +++ b/captcha/experimental.sh @@ -112,24 +112,24 @@ INSTRUCTIONS=$(echo "$(${TRANSFORMATIONS[$RAND_INDEX]})" | cut -d "|" -f 1) INSTRUCTIONS2=$(echo "$(${TRANSFORMATIONS[$RAND_INDEX]})" | cut -d "|" -f 3) TEXT=$(echo "$(${TRANSFORMATIONS[$RAND_INDEX]})" | cut -d "|" -f 2) -convert -size 300x60 xc:none -pointsize 20 \ +convert -size 300x70 xc:none -pointsize 20 \ \( -clone 0 -fill black \ -stroke black -strokewidth 1 \ -font Helvetica-Narrow -annotate "0x0+0+0" "\n $INSTRUCTIONS" \ - -font Helvetica-Bold -annotate "0x0+0+18" "\n $TEXT" \ - -font Helvetica-Narrow -annotate "0x0+0+35" "\n $INSTRUCTIONS2" \ + -font Helvetica-Bold -annotate "0x0+0+20" "\n $TEXT" \ + -font Helvetica-Narrow -annotate "0x0+0+40" "\n $INSTRUCTIONS2" \ -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_$(date "+%Y-%m-%d-%H%M%S")_${INPUT}.png" + -flatten -crop 300x70 +repage -quality 500 -depth 11 png:"/var/lib/ejabberd/chapril_captchas/EXPERIMENTAL_$(date "+%Y-%m-%d-%H%M%S")_${INPUT}.png" -convert -size 300x60 xc:none -pointsize 20 \ +convert -size 300x70 xc:none -pointsize 20 \ \( -clone 0 -fill black \ -stroke black -strokewidth 1 \ -font Helvetica-Narrow -annotate "0x0+0+0" "\n $INSTRUCTIONS" \ - -font Helvetica-Bold -annotate "0x0+0+18" "\n $TEXT" \ - -font Helvetica-Narrow -annotate "0x0+0+36" "\n $INSTRUCTIONS2" \ + -font Helvetica-Bold -annotate "0x0+0+20" "\n $TEXT" \ + -font Helvetica-Narrow -annotate "0x0+0+40" "\n $INSTRUCTIONS2" \ -roll +$ROLL_X+0 \ -wave "$WAVE1_AMPLITUDE"x"$WAVE1_LENGTH" \ -roll -$ROLL_X+0 \) \ - -flatten -crop 300x60 +repage -quality 500 -depth 11 png:- + -flatten -crop 300x70 +repage -quality 500 -depth 11 png:-