diff -r 000000000000 -r b3d8e196dac8 config/rsvg_convert --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/rsvg_convert Tue Jun 29 10:09:34 2021 +0100 @@ -0,0 +1,74 @@ +#!/bin/bash +# A compatibility wrapper for rsvg that makes it act like rsvg-convert +usage() +{ + echo "Usage: rsvg [OPTIONS...] file.svg" + echo " -d, --dpi-x= pixels per inch" + echo " -p, --dpi-y= pixels per inch" + echo " -x, --x-zoom= x zoom factor" + echo " -y, --y-zoom= y zoom factor" + echo " -w, --width= width" + echo " -h, --height= height" +# echo " -q, --quality= JPEG quality" +# echo " -f, --format=[png, jpeg] save format" + echo " -f, --format=[png] save format" + echo " -o, --output= output filename" + echo " -v, --version show version information" + echo "" + echo "Help options:" + echo " -?, --help Show this help message" + echo " --usage Display brief usage message" +} +TEMP=`getopt -s bash -o d:p:x:y:w:h:q:f:o:v \ + --long dpi-x:,dpi-y:,x-zoom:,y-zoom:,width:,height:,quality:,format:,output:,version \ + -n 'rsvg' -- "$@"` +if [ $? != 0 ]; then + usage + exit 1 +fi +eval set -- "$TEMP" +cmd="rsvg" +output="/dev/stdout" +while true; do + case "$1" in + -d|--dpi-x|-p|--dpi-y|-x|--x-zoom|-y|--y-zoom|-w|--width|-h|--height) + cmd="$cmd $1 $2" + shift 2 + ;; + -q|--quality) + echo "rsvg-convert wrapper: jpeg format not supported" + exit 1 + ;; + -f|--format) + if [ "$2" = "png" -o -z "$2" ]; then + cmd="$cmd $1 png" + else + echo "rsvg-convert wrapper: $2 format not supported" + exit 1 + fi + shift 2 + ;; + -o|--output) + output="$2" + shift 2 + ;; + -v|--version) + cmd="$cmd $1" + shift + ;; + --) + shift + break + ;; + *) + echo "Internal error!" >&2 + exit 1 + ;; + esac +done +if [ "$#" -ne 1 ]; then + usage + exit 1 +fi +input="$1" +exec $cmd "$input" "$output"