Skip to content

Commit

Permalink
Fix warped SVG icons, ensure correct rasterized size
Browse files Browse the repository at this point in the history
(cherry picked from commit d993b42)
  • Loading branch information
Willy-JL authored and marmarek committed Aug 23, 2024
1 parent dcf0204 commit dea8b95
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions qubes-rpc/qubes.GetImageRGBA
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit dea8b95

Please sign in to comment.