anpassung für transparente png konvertierung

This commit is contained in:
Eva Möller
2012-08-21 13:43:44 +02:00
parent 8e2f0acb59
commit 76303817a1
3 changed files with 12 additions and 9 deletions
+6 -3
View File
@@ -88,8 +88,9 @@ fi
CHECKFILE=0
SLEEPTIME=0.5
BACKGROUND=''
while getopts "j:i:kc:s:o:hc:" OPT; do # "j:" waits for an argument "h" doesnt
while getopts "j:i:kc:s:o:hc:bc" OPT; do # "j:" waits for an argument "h" doesnt
case $OPT in
h) echo "$USAGE"
exit 0 ;;
@@ -98,6 +99,7 @@ while getopts "j:i:kc:s:o:hc:" OPT; do # "j:" waits for an argument "h" doesnt
c) CFG_FILENAME=$OPTARG ;;
o) OUTDIR=$OPTARG ;;
s) SLEEPTIME=$OPTARG ;;
b) BACKGROUND='-background transparent ';;
i) INPUT_FILENAME=$OPTARG ;;
*) echo "$USAGE" >&2; exit 1; # Default.
esac
@@ -113,15 +115,16 @@ echo $INPUT_FILE
for i in `ls $INPUT_FILE| grep .svg `
do
ID=`echo "$i" | sed -e 's/;.*//g'`
PIC_NAME=`echo "$i" | sed -e 's/.svg/.jpg/g'`
PIC_NAME=`echo "$i" | sed -e 's/.svg//g'`
FILE_PATH=$INPUT_FILE/$PIC_NAME
if [ -s $FILE_PATH ] && [ $CHECKFILE -eq 1 ]
then
echo $PIC_NAME exists
else
RESIZE="${width}x${height}"
SWITCHES="-density $density $INPUT_FILE/$ID -resize $RESIZE $INPUT_FILE/$PIC_NAME"
SWITCHES="-density $density $BACKGROUND$INPUT_FILE/$ID -resize $RESIZE $INPUT_FILE/$PIC_NAME.$format"
CMDLINE="$CMD $SWITCHES"
echo $CMDLINE
(echo $ID; $CMDLINE) &