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