openhab-core/bundles/org.openhab.ui.iconset.classic/icons/_iconconvert
Kai Kreuzer a5b86617a6 initial commit of openhab core components
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2015-12-26 23:22:23 +01:00

37 lines
905 B
Bash
Executable File

#!/bin/sh
for file in $1*.svg; do
if [[ $file != 'none'* ]]; then
png=`echo $file | sed s/.svg/.png/`
# 1. Clean up SVG file.
if hash xmllint; then
# Should be pre-installed on OS X.
xmllint $file -o $file --pretty 1
fi
# 2. Convert SVG files to PNG.
if hash rsvg-convert; then
# Can be installed with Homebrew. (Installation is slow, but conversion is fast.)
# brew install librsvg
rsvg-convert $file -o $png
elif hash svgexport; then
# Can be installed with NPM. (Installation is fast, but conversion is slow.)
# npm install -g svgexport
svgexport $file $png
fi
# 3. Minify PNG files.
if hash imageoptim; then
# Can be installed with NPM. (Note: You must already have the GUI application installed.)
# npm install -g imageoptim-cli
echo $png | imageoptim
fi
fi
done