Skip to content

Commit

Permalink
Merge pull request sqlitebrowser#2275 from scottfurry/convert
Browse files Browse the repository at this point in the history
Update to Windows Icon Generation script
  • Loading branch information
justinclift authored Jun 7, 2020
2 parents fa04d72 + 90698e5 commit 044e484
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Binary file modified src/iconwin.ico
Binary file not shown.
17 changes: 12 additions & 5 deletions src/tools/create_windows_icon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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[@]}"

0 comments on commit 044e484

Please sign in to comment.