summaryrefslogtreecommitdiff
path: root/icons/tools
diff options
context:
space:
mode:
authorTim Hockin <thockin@google.com>2021-02-02 10:22:47 -0800
committerTim Hockin <thockin@google.com>2021-02-02 10:27:38 -0800
commit42c73657201bc94eb5066f6bc0b436dd1b2960f7 (patch)
treec38910bd40db9056bf1821bd3f439facc8261c81 /icons/tools
parent51a90adf63ce5840805d700dc3370d8ca72a7223 (diff)
Fix aspect ratio on all PNG icons
We only need to fix the width, the height will be proportional automatically.
Diffstat (limited to 'icons/tools')
-rwxr-xr-xicons/tools/rasterize.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/icons/tools/rasterize.sh b/icons/tools/rasterize.sh
index a7c10fdc..a358d1db 100755
--- a/icons/tools/rasterize.sh
+++ b/icons/tools/rasterize.sh
@@ -4,7 +4,7 @@ SIZES=(128 256)
docker build -t svgconvertor:latest -f tools/Dockerfile .
-total=$(ls svg/*/*/* | wc -l)
+total=$(($(ls svg/*/*/* | wc -l) * "${#SIZES[@]}"))
counter=1
for size in "${SIZES[@]}"; do
@@ -13,7 +13,9 @@ for size in "${SIZES[@]}"; do
mkdir -p png/$dir
output=png/${svg%%.*}-$size.png
echo "[$counter/$total] Generating $output"
- docker run -v $(pwd)/svg:/convertor svgconvertor:latest $svg -h $size -w $size > $output
+ # Only specify the width, since we know heptagons are wider than they
+ # are tall. The tool will automatically retain the source aspect ratio.
+ docker run -v $(pwd)/svg:/convertor svgconvertor:latest $svg -w $size > $output
counter=$[$counter +1]
done
done