Use rsvg-convert instead of GIMP for converting SVG to PNG.
[pspp] / build-aux / svg2png
1 #! /bin/sh
2
3 # Convert svg file to png with a target width and height
4 # width and height are derived from the directory name
5 # of the target. Width and height must be equal
6
7 # Arg1: Source svg file
8 # Arg2: Filename for copyright notice
9 # Arg3: Target png file
10
11 # Extract the icon width from the target path e.g.
12 # src/ui/gui/icons/48x48/actions/file-save.png
13 # should result in a width of 48
14 stripprefix=${3#src*icons\/}
15 width=${stripprefix%%x*}
16
17 comment=`cat $2`
18 case $width in
19     [0-9][0-9] | [0-9][0-9][0-9]) widthoption="--width=$width --height=$width" ;;
20     *) widthoption= ;;
21 esac
22 rsvg-convert $widthoption "$1" | ${PYTHON3:-python3} build-aux/png-add-comment Comment "$comment" > "$3"