-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate-images.sh
executable file
·66 lines (49 loc) · 1.74 KB
/
generate-images.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
rm -rf tmp
mkdir tmp
rm -rf tgc
mkdir tgc
mkdir tgc/ships
mkdir tgc/planets
mkdir tgc/industry
mkdir tgc/statecraft
mkdir tgc/science
mkdir tgc/back
mkdir tgc/rules
gsc -dNOPAUSE -sDEVICE=png16m -r256 -sOutputFile=tmp/%01d.png cards.pdf -c quit;
magick mogrify -format webp tmp/*.png
node rename-cards.js
magick mogrify -resize 50% tmp/*-thumb.webp
sips --resampleHeightWidth 1125 825 tgc/industry/*.png
sips --resampleHeightWidth 1125 825 tgc/statecraft/*.png
sips --resampleHeightWidth 1125 825 tgc/science/*.png
sips --resampleHeightWidth 1125 825 tgc/ships/*.png
sips -r 270 tgc/planets/*.png
sips --resampleHeightWidth 1125 825 tgc/planets/*.png
# cp public/back.jpg tgc/back.jpg
cp public/industry.png tgc/back/industry.png
cp public/planet.png tgc/back/planet.png
cp public/science.png tgc/back/science.png
cp public/ship.png tgc/back/ship.png
cp public/statecraft.png tgc/back/statecraft.png
sips --resampleHeightWidth 1125 825 tgc/back/*.png
rm -rf ./public/cards
mv ./tmp ./public/cards
cp cardlist-main.csv ./public/cards/cardlist-main.csv
cp cardlist-planets.csv ./public/cards/cardlist-planets.csv
npm run rulebook:gen
gsc -dNOPAUSE -sDEVICE=png16m -r256 -sOutputFile=tgc/rules/page%02d.png rulebook/rulebook.pdf -c quit;
PAGE=1
sips --resampleHeightWidth 2475 1575 tgc/rules/*.png
for f in ./tgc/rules/*.png;
do
echo "Processing $f file...";
magick convert $f ./public/numbered/page"$PAGE".png -flatten $f
PAGE=$((PAGE+1))
done
cp public/frontcover.png tgc/rules/0.png
cp public/backcover.png tgc/rules/z.png
# cp public/blankpage.png tgc/rules/00.png
cp public/backsplash.png tgc/rules/y.png
sips --resampleHeightWidth 2475 1575 tgc/rules/*.png
magick convert tgc/rules/*png rules/.vuepress/public/star_commander_rulebook.pdf