forked from qo-op/G1BILLET
PLANCHE G1BILLETS => /tmp/g1billet/${UNIQID}.pdf
This commit is contained in:
parent
887591de29
commit
08115f76f7
@ -43,4 +43,10 @@ montage /tmp/g1billet/${UNIQID}/*.jpg -tile 2x3 -geometry 964x459 /tmp/g1billet/
|
|||||||
# NB!! if "not autorized" then edit /etc/ImageMagick-6/policy.xml and comment
|
# NB!! if "not autorized" then edit /etc/ImageMagick-6/policy.xml and comment
|
||||||
# <!-- <policy domain="coder" rights="none" pattern="PDF" /> -->
|
# <!-- <policy domain="coder" rights="none" pattern="PDF" /> -->
|
||||||
|
|
||||||
|
# CLEANING TEMP FILES
|
||||||
|
# rm -Rf /tmp/g1billet/${UNIQID}
|
||||||
|
|
||||||
|
# ALLOWS ANY USER TO DELETE
|
||||||
|
chmod 777 /tmp/g1billet/${UNIQID}.pdf
|
||||||
|
|
||||||
exit
|
exit
|
||||||
|
@ -39,33 +39,33 @@ composite -compose Over -gravity NorthEast -geometry +50+25 "/tmp/g1billet/${UNI
|
|||||||
# Change June logo color
|
# Change June logo color
|
||||||
case "$MONTANT" in
|
case "$MONTANT" in
|
||||||
1)
|
1)
|
||||||
convert "${MY_PATH}/images/g1.png" -fuzz 20% -fill grey -opaque '#e5912b' "/tmp/g1.png"
|
convert "${MY_PATH}/images/g1.png" -fuzz 20% -fill grey -opaque '#e5912b' "/tmp/g1billet/g1.png"
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
convert "${MY_PATH}/images/g1.png" -fuzz 20% -fill green -opaque '#e5912b' "/tmp/g1.png"
|
convert "${MY_PATH}/images/g1.png" -fuzz 20% -fill green -opaque '#e5912b' "/tmp/g1billet/g1.png"
|
||||||
;;
|
;;
|
||||||
5)
|
5)
|
||||||
convert "${MY_PATH}/images/g1.png" -fuzz 20% -fill orange -opaque '#e5912b' "/tmp/g1.png"
|
convert "${MY_PATH}/images/g1.png" -fuzz 20% -fill orange -opaque '#e5912b' "/tmp/g1billet/g1.png"
|
||||||
;;
|
;;
|
||||||
10)
|
10)
|
||||||
convert "${MY_PATH}/images/g1.png" -fuzz 20% -fill blue -opaque '#e5912b' "/tmp/g1.png"
|
convert "${MY_PATH}/images/g1.png" -fuzz 20% -fill blue -opaque '#e5912b' "/tmp/g1billet/g1.png"
|
||||||
;;
|
;;
|
||||||
20)
|
20)
|
||||||
convert "${MY_PATH}/images/g1.png" -fuzz 20% -fill purple -opaque '#e5912b' "/tmp/g1.png"
|
convert "${MY_PATH}/images/g1.png" -fuzz 20% -fill purple -opaque '#e5912b' "/tmp/g1billet/g1.png"
|
||||||
;;
|
;;
|
||||||
50)
|
50)
|
||||||
convert "${MY_PATH}/images/g1.png" -fuzz 20% -fill red -opaque '#e5912b' "/tmp/g1.png"
|
convert "${MY_PATH}/images/g1.png" -fuzz 20% -fill red -opaque '#e5912b' "/tmp/g1billet/g1.png"
|
||||||
;;
|
;;
|
||||||
100)
|
100)
|
||||||
convert "${MY_PATH}/images/g1.png" -fuzz 20% -fill black -opaque '#e5912b' "/tmp/g1.png"
|
convert "${MY_PATH}/images/g1.png" -fuzz 20% -fill black -opaque '#e5912b' "/tmp/g1billet/g1.png"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
cp "${MY_PATH}/images/g1.png" "/tmp/g1.png"
|
cp "${MY_PATH}/images/g1.png" "/tmp/g1billet/g1.png"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Add June LOGO to Billet
|
# Add June LOGO to Billet
|
||||||
composite -compose Over -gravity SouthEast -geometry +20+20 -dissolve 90% "/tmp/g1.png" "/tmp/${BILLETNAME}.jpg" "/tmp/${BILLETNAME}.jpg"
|
composite -compose Over -gravity SouthEast -geometry +20+20 -dissolve 90% "/tmp/g1billet/g1.png" "/tmp/${BILLETNAME}.jpg" "/tmp/${BILLETNAME}.jpg"
|
||||||
|
|
||||||
convert -font 'Liberation-Sans' \
|
convert -font 'Liberation-Sans' \
|
||||||
-pointsize 120 -fill black -draw 'text 250,250 "'"$MONTANT DU"'"' \
|
-pointsize 120 -fill black -draw 'text 250,250 "'"$MONTANT DU"'"' \
|
||||||
|
@ -48,8 +48,8 @@ cd G1BILLET
|
|||||||
Ajoutez les dépendances nécessaire
|
Ajoutez les dépendances nécessaire
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo apt install imagemagick qrencode ttf-mscorefonts-installer
|
sudo apt install python3 python3-pip imagemagick qrencode ttf-mscorefonts-installer
|
||||||
pip3 install duniterpy
|
sudo pip3 install duniterpy
|
||||||
```
|
```
|
||||||
|
|
||||||
NB: Si une erreur du type "not autorized" apparait, vous devez autoriser la création de pdf en editant /etc/ImageMagick-6/policy.xml pour commenter la ligne:
|
NB: Si une erreur du type "not autorized" apparait, vous devez autoriser la création de pdf en editant /etc/ImageMagick-6/policy.xml pour commenter la ligne:
|
||||||
|
@ -3,7 +3,6 @@ $mytime = new Datetime("now");
|
|||||||
$timestamp = $mytime->format('U');
|
$timestamp = $mytime->format('U');
|
||||||
|
|
||||||
// CREATE 6 G1BILLETS in /tmp/g1billet/$timestamp
|
// CREATE 6 G1BILLETS in /tmp/g1billet/$timestamp
|
||||||
echo dirname(__FILE__)."/G1BILLETS.sh";
|
|
||||||
$page = shell_exec(dirname(__FILE__)."/G1BILLETS.sh '".$_REQUEST['montant']."' '".$timestamp."' 2>&1 >> /tmp/g1billet.log");
|
$page = shell_exec(dirname(__FILE__)."/G1BILLETS.sh '".$_REQUEST['montant']."' '".$timestamp."' 2>&1 >> /tmp/g1billet.log");
|
||||||
|
|
||||||
$attachment_location = "/tmp/g1billet/".$timestamp.".pdf";
|
$attachment_location = "/tmp/g1billet/".$timestamp.".pdf";
|
||||||
@ -19,5 +18,8 @@ if (file_exists($attachment_location)) {
|
|||||||
} else {
|
} else {
|
||||||
die("Error: File not found.");
|
die("Error: File not found.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shell_exec(rm -f "/tmp/g1billet/".$timestamp.".pdf");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user