-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'gh-pages' into gh-pages
- Loading branch information
Showing
32 changed files
with
5,537 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
#!/usr/bin/env sh | ||
|
||
echo "Options: w, width, h, height, n, normal, default" | ||
echo -n "Enter your option: " | ||
read OPTION | ||
|
||
echo "" | ||
|
||
echo "Options: yes, true, 1" | ||
echo -n "Do you want to optimize the converted file? " | ||
read OPTIPNGOP | ||
|
||
updatealiases(){ | ||
echo "Updating aliases!" | ||
IFS=' ' | ||
while read dst src; do | ||
for dir in png; do | ||
s="$dir/$src.$dir" | ||
d="$dir/$dst.$dir" | ||
cp -f "$s" "$d" | ||
done | ||
done < data/ALIASES | ||
} | ||
|
||
rsvgconvert() { | ||
case $OPTIPNGOP in | ||
"yes" | "true" | "1") | ||
echo "Converting svg/$region.svg to png/$region.png.tmp" | ||
if ! rsvg-convert $1 -f png -o "png/$region.png.tmp" "svg/$region.svg"; then | ||
echo "ERROR rsvg-convert failed." | ||
rm -f "png/$region.png.tmp" | ||
else | ||
echo "Optimizing png/$region.png!" | ||
if ! optipng -quiet "png/$region.png.tmp"; then | ||
echo "ERROR: optipng failed." | ||
rm -f "png/$region.png.tmp" | ||
continue | ||
else | ||
mv "png/$region.png.tmp" "png/$region.png" | ||
fi | ||
fi | ||
echo "" | ||
;; | ||
|
||
*) | ||
echo "Converting svg/$region.svg to png/$region.png" && rsvg-convert $1 -f png -o "png/$region.png" "svg/$region.svg" | ||
;; | ||
esac | ||
} | ||
|
||
usersvgconvert() { | ||
|
||
WIDTH=$1; | ||
HEIGHT=$2; | ||
|
||
if [ $WIDTH -ne 0 ]; then | ||
IFS=' ' | ||
cat SOURCES | | ||
while read region htmlurl ; do | ||
if [ -f "svg/$region.svg" ]; then | ||
rsvgconvert "-a -w ${WIDTH}" | ||
else | ||
echo "File svg/$region.svg doesn't exist!" | ||
fi | ||
done | ||
fi | ||
|
||
if [ $HEIGHT -ne 0 ]; then | ||
IFS=' ' | ||
cat SOURCES | | ||
while read region htmlurl ; do | ||
if [ -f "svg/$region.svg" ]; then | ||
rsvgconvert "-a -h ${HEIGHT}" | ||
else | ||
echo "File svg/$region.svg doesn't exist!" | ||
fi | ||
done | ||
fi | ||
|
||
if [ $WIDTH -eq 0 ] && [ $HEIGHT -eq 0 ]; then | ||
|
||
IFS=' ' | ||
cat SOURCES | | ||
while read region htmlurl ; do | ||
if [ -f "svg/$region.svg" ]; then | ||
rsvgconvert "-a" | ||
else | ||
echo "File svg/$region.svg doesn't exist!" | ||
fi | ||
done | ||
fi | ||
|
||
updatealiases | ||
} | ||
|
||
|
||
case $OPTION in | ||
w | width) | ||
echo -n "Enter the prefered width: " | ||
read WIDTH | ||
usersvgconvert ${WIDTH} 0 | ||
;; | ||
|
||
h | height) | ||
echo -n "Enter the prefered height: " | ||
read HEIGHT | ||
usersvgconvert 0 ${HEIGHT} | ||
;; | ||
|
||
n | normal | default) | ||
usersvgconvert 0 0 | ||
;; | ||
|
||
*) | ||
echo "Unknown option!" | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
; ISO 3166-2:AU | ||
; Source: https://www.iso.org/obp/ui/#iso:code:3166:AU | ||
; Extracted on: 20201128 | ||
; | ||
; Subdivision category 3166-2 code Subdivision name Language code Romanization system Parent subdivision | ||
territory AU-ACT Australian Capital Territory en | ||
state AU-NSW New South Wales en | ||
territory AU-NT Northern Territory en | ||
state AU-QLD Queensland en | ||
state AU-SA South Australia en | ||
state AU-TAS Tasmania en | ||
state AU-VIC Victoria en | ||
state AU-WA Western Australia en |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.