Compare commits
3 Commits
bbd483e977
...
f9bf266511
Author | SHA1 | Date | |
---|---|---|---|
|
f9bf266511 | ||
e5eed115a4 | |||
1e774e4076 |
@ -32,29 +32,15 @@ else
|
|||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DECOUPE()
|
|
||||||
{
|
|
||||||
LENGTH=${#INPUT}
|
|
||||||
MID=$((LENGTH / 2))
|
|
||||||
|
|
||||||
get_random
|
|
||||||
R=$(($R % 2))
|
|
||||||
|
|
||||||
if [[ $R -eq 1 ]]; then
|
|
||||||
echo "Tapez ${INPUT:0:$MID}\n suivi de ${INPUT:$MID:$MID}"
|
|
||||||
else
|
|
||||||
echo "Saisissez ${INPUT:0:$MID}\n puis ${INPUT:$MID:$MID}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
INTRUS()
|
INTRUS()
|
||||||
{
|
{
|
||||||
LENGTH=${#INPUT}
|
LENGTH=${#INPUT}
|
||||||
NUMBERS=$(echo $INPUT | grep -o . | tr '\n' ' ')
|
NUMBERS=$(echo $INPUT | grep -o . | tr '\n' ' ')
|
||||||
SORTED_UNIQ_NUM=$(echo "${NUMBERS[@]}" | sort -u | tr '\n' ' ')
|
SORTED_UNIQ_NUM=$(echo "${NUMBERS[@]}" | sort -u | tr '\n' ' ')
|
||||||
|
RANDOM_DIGITS=$(echo 123456789 | grep -o . | sort -R | tr '\n' ' ')
|
||||||
INTRUS=-1
|
INTRUS=-1
|
||||||
|
|
||||||
for i in 1 2 3 4 5 6 7 8 9
|
for i in ${RANDOM_DIGITS[@]}
|
||||||
do
|
do
|
||||||
if [[ ! " ${SORTED_UNIQ_NUM[@]} " =~ " ${i} " ]]; then
|
if [[ ! " ${SORTED_UNIQ_NUM[@]} " =~ " ${i} " ]]; then
|
||||||
INTRUS=$i
|
INTRUS=$i
|
||||||
@ -125,6 +111,15 @@ RAND_ANGLE=$(($R % 3))
|
|||||||
get_random
|
get_random
|
||||||
RAND_INDEX=$(($R % ${#TRANSFORMATIONS[@]}))
|
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/$(date "+%Y-%m-%d-%H%M%S")_${INPUT}.png"
|
||||||
|
|
||||||
convert -size 300x60 xc:none -pointsize 20 \
|
convert -size 300x60 xc:none -pointsize 20 \
|
||||||
\( -clone 0 -fill black \
|
\( -clone 0 -fill black \
|
||||||
-stroke black -strokewidth 1 \
|
-stroke black -strokewidth 1 \
|
||||||
|
@ -125,6 +125,15 @@ RAND_ANGLE=$(($R % 3))
|
|||||||
get_random
|
get_random
|
||||||
RAND_INDEX=$(($R % ${#TRANSFORMATIONS[@]}))
|
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_$(date "+%Y-%m-%d-%H%M%S")_{INPUT}.png"
|
||||||
|
|
||||||
convert -size 300x60 xc:none -pointsize 20 \
|
convert -size 300x60 xc:none -pointsize 20 \
|
||||||
\( -clone 0 -fill black \
|
\( -clone 0 -fill black \
|
||||||
-stroke black -strokewidth 1 \
|
-stroke black -strokewidth 1 \
|
||||||
|
Loading…
Reference in New Issue
Block a user