fix(gtk2, xfwm: render_asset.sh): fix filename if rendering with different dpi

master
actionless 2018-08-09 12:32:09 +02:00
parent 1c0dda2868
commit bf0662c0ae
2 changed files with 14 additions and 26 deletions

View File

@ -9,27 +9,21 @@ SRC_FILE="${ASSETS_DIR}".svg
i="$2"
result_file="$ASSETS_DIR/$i.png"
if [[ -f "${result_file}" ]] ; then
echo "${result_file} already exists."
else
echo "Rendering '${result_file}'"
"$INKSCAPE" --export-id="$i" \
--export-id-only \
--export-png="${result_file}" "$SRC_FILE" >/dev/null \
&& "$OPTIPNG" -o7 --quiet "${result_file}"
fi
if [[ "$OPTION_GTK2_HIDPI" == "true" ]]; then
result_file_hidpi="$ASSETS_DIR/$i@2.png"
if [[ -f "${result_file_hidpi}" ]] ; then
echo "${result_file_hidpi} already exists."
if [[ "$OPTION_GTK2_HIDPI" != "true" ]]; then
"$INKSCAPE" --export-id="$i" \
--export-id-only \
--export-png="${result_file}" "$SRC_FILE" >/dev/null
else
echo "Rendering '${result_file_hidpi}'"
"$INKSCAPE" --export-id="$i" \
--export-id-only \
--export-dpi=192 \
--export-png="${result_file_hidpi}" "$SRC_FILE" >/dev/null \
&& "$OPTIPNG" -o7 --quiet "${result_file_hidpi}"
--export-png="${result_file}" "$SRC_FILE" >/dev/null
fi
"$OPTIPNG" -o7 --quiet "${result_file}"
fi

View File

@ -9,27 +9,21 @@ SRC_FILE="${ASSETS_DIR}".svg
i="$2"
result_file="$ASSETS_DIR/$i.png"
if [[ -f "${result_file}" ]] ; then
echo "${result_file} already exists."
else
echo "Rendering '${result_file}'"
"$INKSCAPE" --export-id="$i" \
--export-id-only \
--export-png="${result_file}" "$SRC_FILE" >/dev/null \
&& "$OPTIPNG" -o7 --quiet "${result_file}"
fi
if [[ "$OPTION_GTK2_HIDPI" == "true" ]]; then
result_file_hidpi="$ASSETS_DIR/$i@2.png"
if [[ -f "${result_file_hidpi}" ]] ; then
echo "${result_file_hidpi} already exists."
if [[ "$OPTION_GTK2_HIDPI" != "true" ]]; then
"$INKSCAPE" --export-id="$i" \
--export-id-only \
--export-png="${result_file}" "$SRC_FILE" >/dev/null
else
echo "Rendering '${result_file_hidpi}'"
"$INKSCAPE" --export-id="$i" \
--export-id-only \
--export-dpi=192 \
--export-png="${result_file_hidpi}" "$SRC_FILE" >/dev/null \
&& "$OPTIPNG" -o7 --quiet "${result_file_hidpi}"
--export-png="${result_file}" "$SRC_FILE" >/dev/null
fi
"$OPTIPNG" -o7 --quiet "${result_file}"
fi