From 7a4f203de6ba2551e84dab4b36de443f2393a088 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 3 Apr 2021 08:10:58 +0300 Subject: [PATCH 41/41] convert_png: Make to work with Inkscape 1.0.2 See osdn #41884 Signed-off-by: Marko Lindqvist --- data/flags/convert_png | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/data/flags/convert_png b/data/flags/convert_png index 4cf2caaa12..8c4fa3831b 100755 --- a/data/flags/convert_png +++ b/data/flags/convert_png @@ -40,7 +40,7 @@ for file0 in $files; do # This is actually necessary for rendering rm -f $file1 $file2 $file3 $file4 - $RENDERER -f "$file0" -w $(($TARGET_WIDTH - 2)) -e "$file1" >/dev/null + $RENDERER "$file0" -w $(($TARGET_WIDTH - 2)) -o "$file1" >/dev/null # Ugly way to determine width and height. There must be a better way! SIZE=`identify "$file1" | sed "s/^.*PNG //" | sed "s/ .*\$//"` @@ -63,15 +63,15 @@ for file0 in $files; do HEIGHT=$(($SHIELD_HEIGHT-2)) # The following assumes that the drawing has the same dimensions as the page - DRAWING_WIDTH=$($RENDERER -f $file0 -W) - DRAWING_HEIGHT=$($RENDERER -f $file0 -H) + DRAWING_WIDTH=$($RENDERER $file0 -W) + DRAWING_HEIGHT=$($RENDERER $file0 -H) X0=$(awk -v drawing_width=${DRAWING_WIDTH} 'BEGIN { print int((drawing_width / 6) + 0.5) }') X1=$(awk -v x0=${X0} 'BEGIN{ print int((x0 * 5) + 0.5) }') Y0=0 Y1=$(awk -v drawing_height=${DRAWING_HEIGHT} 'BEGIN { print int(drawing_height + 0.5) }') AREA=$X0":"$Y0":"$X1":"$Y1 - $RENDERER -f $file0 -w $WIDTH -h $HEIGHT -e $file1 -a=$AREA > /dev/null + $RENDERER $file0 -w $WIDTH -h $HEIGHT -o $file1 --export-area=$AREA > /dev/null composite -gravity center -compose src-over $file1 mask.png $file2 composite -gravity center -compose src-over mask.png $file2 $file3 @@ -91,7 +91,7 @@ for file0 in $files; do # This is actually necessary for rendering rm -f $file1 $file2 $file3 $file4 - $RENDERER -f "$file0" -w $(($TARGET_WIDTH_LARGE - 2)) -e "$file1" >/dev/null + $RENDERER "$file0" -w $(($TARGET_WIDTH_LARGE - 2)) -o "$file1" >/dev/null # Ugly way to determine width and height. There must be a better way! SIZE=`identify "$file1" | sed "s/^.*PNG //" | sed "s/ .*\$//"` @@ -114,15 +114,15 @@ for file0 in $files; do HEIGHT=$(($SHIELD_HEIGHT_LARGE-2)) # The following assumes that the drawing has the same dimensions as the page - DRAWING_WIDTH=$($RENDERER -f $file0 -W) - DRAWING_HEIGHT=$($RENDERER -f $file0 -H) + DRAWING_WIDTH=$($RENDERER $file0 -W) + DRAWING_HEIGHT=$($RENDERER $file0 -H) X0=$(awk -v drawing_width=${DRAWING_WIDTH} 'BEGIN { print int((drawing_width / 6) + 0.5) }') X1=$(awk -v x0=${X0} 'BEGIN{ print int((x0 * 5) + 0.5) }') Y0=0 Y1=$(awk -v drawing_height=${DRAWING_HEIGHT} 'BEGIN { print int(drawing_height + 0.5) }') AREA=$X0":"$Y0":"$X1":"$Y1 - $RENDERER -f $file0 -w $WIDTH -h $HEIGHT -e $file1 -a=$AREA > /dev/null + $RENDERER $file0 -w $WIDTH -h $HEIGHT -o $file1 --export-area=$AREA > /dev/null composite -gravity center -compose src-over $file1 mask-large.png $file2 composite -gravity center -compose src-over mask-large.png $file2 $file3 -- 2.30.2