From a2c86b587bb7fe12d04656d7f142e8f5bc1ac066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C5=A1nar?= Date: Mon, 2 Dec 2024 18:05:26 +0100 Subject: [PATCH] tools for generating cards --- tools/get_employees.php | 23 +++++++++++++++++++++++ tools/process.bash | 9 +++++++++ 2 files changed, 32 insertions(+) create mode 100644 tools/get_employees.php create mode 100755 tools/process.bash diff --git a/tools/get_employees.php b/tools/get_employees.php new file mode 100644 index 0000000..486508f --- /dev/null +++ b/tools/get_employees.php @@ -0,0 +1,23 @@ + diff --git a/tools/process.bash b/tools/process.bash new file mode 100755 index 0000000..9041b6d --- /dev/null +++ b/tools/process.bash @@ -0,0 +1,9 @@ +!#/bin/bash +cat students.json | jq -c '.Zaci[]|{id: .PkZak, name: .Jmeno, surname: .Prijmeni }' | while read line; do + id=$(echo $line | jq -r '.id') + name=$(echo $line | jq -r '.name') + surname=$(echo $line | jq -r '.surname') + echo "Processing $name $surname " + qrencode -o "qrcodes/$id.png" $line + convert -size 1000x640 xc:white templates/background.png -geometry 500x460+0+200 -composite templates/logo.png -geometry 420x100+40+40 -composite -background transparent -fill black -size 420x240 -font templates/Quicksand-VariableFont_wght.ttf caption:"$name\n$surname" -geometry +40+220 -composite qrcodes/$id.png -geometry 420x420+540+140 -composite "cards/$name-$surname.png" +done