From d993b424c4b1758b999194ff6a02470f14803692 Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Sat, 27 Jul 2024 02:03:00 +0200 Subject: [PATCH] Fix warped SVG icons, ensure correct rasterized size --- qubes-rpc/qubes.GetImageRGBA | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qubes-rpc/qubes.GetImageRGBA b/qubes-rpc/qubes.GetImageRGBA index 097196b7c..b56ab02ca 100755 --- a/qubes-rpc/qubes.GetImageRGBA +++ b/qubes-rpc/qubes.GetImageRGBA @@ -27,16 +27,16 @@ h="$(echo "$s"|cut -d " " -f 2)" m="$(echo "$s"|cut -d " " -f 3)" if [ "$m" = SVG ]; then tmpfile2="$(mktemp /tmp/qimg-XXXXXXXX.png)" - rsvg-convert -o "$tmpfile2" "$filename" + rsvg-convert -w "$w" -h "$h" -o "$tmpfile2" "$filename" # downscale the image if necessary if [ -n "$forcemaxsize" ] && \ { [ "$w" -gt "$forcemaxsize" ] || [ "$h" -gt "$forcemaxsize" ]; }; then gm convert "$tmpfile2" -scale "${forcemaxsize}x${forcemaxsize}" "$tmpfile2" - # read the size again, because icon may not be a square - s="$(gm identify -format '%w %h' "$tmpfile2")" - w="$(echo "$s"|cut -d " " -f 1)" - h="$(echo "$s"|cut -d " " -f 2)" fi + # read the size again, because icon may not be a square or could have changed with convert + s="$(gm identify -format '%w %h' "$tmpfile2")" + w="$(echo "$s"|cut -d " " -f 1)" + h="$(echo "$s"|cut -d " " -f 2)" filename="$tmpfile2" fi echo "$w $h"