src/gtk/render-asset.sh
@@ -5,6 +5,12 @@ RENDER_SVG="$(command -v rendersvg)" || true
INKSCAPE="$(command -v inkscape)" || true
OPTIPNG="$(command -v optipng)" || true
if "$INKSCAPE" --help | grep -e "--export-png" > /dev/null; then
EXPORT_FILE_OPTION="--export-png"
else
EXPORT_FILE_OPTION="--export-file"
fi
SRC_FILE="assets.svg"
ASSETS_DIR="assets"
@@ -17,7 +23,7 @@ if [[ -n "${RENDER_SVG}" ]]; then
else
"$INKSCAPE" --export-id="$i" \
--export-id-only \
--export-png="$ASSETS_DIR/$i.png" "$SRC_FILE" >/dev/null
"$EXPORT_FILE_OPTION"="$ASSETS_DIR/$i.png" "$SRC_FILE" >/dev/null
fi
if [[ -n "${OPTIPNG}" ]]; then
"$OPTIPNG" -o7 --quiet "$ASSETS_DIR/$i.png"