Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/517'
Browse files Browse the repository at this point in the history
* origin/pr/517:
  Fix warped SVG icons, ensure correct rasterized size
  • Loading branch information
marmarek committed Aug 8, 2024
2 parents 08fe31f + d993b42 commit 7984de2
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 7984de2

Please sign in to comment.