keepassxc/share/windows/create-ico.sh
Jonathan White 90d5372813
Replace database icons with SVG's
Original source of icons is the icon8 library (http://icons8.com/c/flat-color-icons) and Paomedia (https://github.com/paomedia/small-n-flat). All icons used are licensed MIT or CC0; annotated in COPYING.

* Closes #4071

* Increase default size of database icons to 24px and entry preview panel to 48px
* Add shell script to assemble the database icons

* Use QIcon to seamlessly support High DPI displays and pixmap caching
* Add badge support for KeeShare groups and expired entries.
* Guard against use of QPixmap::fromImage without a GUI

* Add SVG minify and improve `make icons`

Co-authored-by: Wolfram Rösler <wolfram@roesler-ac.de>
2020-05-29 10:00:32 -04:00

32 lines
633 B
Bash

#!/usr/bin/env bash
NC='\033[0m'
RED='\033[0;31m'
YELLOW='\033[0;33m'
if [[ -z "$1" ]]; then
echo -e "${RED}You must include an SVG file to convert!${NC}"
exit 1
fi
outfile=$2
if [[ -z "outfile" ]]; then
outfile="logo.ico"
fi
if ! command -v "inkscape" &> /dev/null; then
echo -e "${YELLOW}Could not find inkscape; $outfile not built!${NC}"
exit 0
fi
echo "Generating $outfile from $1..."
size_list=(16 24 32 48 64 128 256)
for size in ${size_list[@]}; do
inkscape -z -e $size.png -w $size -h $size "$1" >/dev/null 2>/dev/null
done
images=`printf "%s.png " "${size_list[@]}"`
convert $images $outfile
rm $images