tahoe-lafs/misc/build_helpers/icons/make-windows-icon.sh
Daira Hopwood 88b735b6be Build Tahoe-LAFS icon for OS X and Windows. refs ticket:2323
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-04-30 15:24:12 +01:00

24 lines
609 B
Bash
Executable File

#! /bin/bash
# Based on <http://stackoverflow.com/a/23688878/393146>
# converts the passed-in svgs to ico format
if [[ "$#" -eq 0 ]]; then
echo "Usage: $0 svg1 [svg2 [...]]"
exit 0
fi
temp="$(mktemp -d)"
declare -a res=(16 24 32 48 64 256)
for f in "$*"; do
name="`basename -s .svg "$f"`"
iconset="$temp/${name}.iconset"
mkdir -p "$iconset"
for r in "${res[@]}"; do
inkscape -z -e "$iconset/${name}${r}.png" -w "$r" -h "$r" "$f"
done
resm=( "${res[@]/#/$iconset/${name}}" )
resm=( "${resm[@]/%/.png}" )
convert "${resm[@]}" "${f%%.*}.ico"
done
rm -rf "$temp"