aboutsummaryrefslogtreecommitdiff
path: root/src/genTestImgs.sh
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-03-02 15:05:19 +1100
committerTerry Truong <terry06890@gmail.com>2022-03-02 16:18:14 +1100
commit7a12c7ffa50d67f550592bf096e6ab4a42732983 (patch)
tree6e417687d00b11059e39f1423f8183c332ca93ef /src/genTestImgs.sh
parentaf1555e223ebb1b1813b9b85f4cf8dddc432189e (diff)
Add test data and images
Diffstat (limited to 'src/genTestImgs.sh')
-rwxr-xr-xsrc/genTestImgs.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/genTestImgs.sh b/src/genTestImgs.sh
new file mode 100755
index 0000000..34e3921
--- /dev/null
+++ b/src/genTestImgs.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+set -e
+
+#reads through tol.json, gets names, and generates image for each name
+cat tol.json | \
+ gawk 'match ($0, /"name"\s*:\s*"(.*)"/, arr) {print arr[1]}' | \
+ while read; do
+ convert -size 400x400 xc:khaki +repage \
+ -size 300x300 -fill black -background None \
+ -font Ubuntu-Mono -gravity center caption:"$REPLY" +repage \
+ -gravity Center -composite -strip assets/"$REPLY".jpg
+ done
+