Update to Windows Icon Generation script

Update script `src/tools/create_windows_icon.sh`.
Script uses Imagemagick `convert` command and requires attention to ordering of arguments.

Script update for use w/ Bash 5
This commit is contained in:
Scott Furry
2020-06-07 00:17:51 -06:00
parent fa04d72f20
commit 90698e5dc3
2 changed files with 12 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

View File

@@ -2,11 +2,18 @@
# This script depends on ImageMagick being installed
FILES=() # array accumulating names of converted images
# commands to give to convert for each iteration
MAGICK_CMDS="+antialias -units PixelsPerInch -alpha set -background transparent"
SRC_FILE="../../images/logo.svg" # conversion source
ICO_FILE="../iconwin.ico" # ouput icon file
for imgsize in 16 32 64 128
do
convert ../../images/logo.svg -resize "$imgsize"x"$imgsize" -background transparent icon"$imgsize".png
files="$files icon$imgsize.png"
RESIZE="${imgsize}x${imgsize}"
DEST_FILE="icon${imgsize}.png"
# NOTE: explicitly not using quotes - outpput raw contents to convert command
convert ${MAGICK_CMDS} ${SRC_FILE} -resize ${RESIZE} ${DEST_FILE}
FILES+=("${DEST_FILE}")
done
convert $files ../iconwin.ico
rm $files
convert "${FILES[@]}" "${ICO_FILE}"
rm "${FILES[@]}"