From 8549186c4175a83014e988cacbe383a5aefd5057 Mon Sep 17 00:00:00 2001 From: nojhan Date: Wed, 8 Feb 2012 08:19:09 +0100 Subject: [PATCH] script for automatic PNG export --- README | 2 ++ export.sh | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100755 export.sh diff --git a/README b/README index 50b59e8..6265fdc 100644 --- a/README +++ b/README @@ -1 +1,3 @@ Set of Hanafuda cards in the form of 12 pictures in the SVG format. + +Run export.sh to export the large pictures and the cards in PNG files. diff --git a/export.sh b/export.sh new file mode 100755 index 0000000..db8b539 --- /dev/null +++ b/export.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +# for each svg file +for svg in `find . -name *.svg` ; do + + # the complete filename without the extension + base=`echo $svg | sed s/.svg//` + + # export each 4 cards + for i in `seq 4` ; do + inkscape --export-png=${base}_card_$i.png --without-gui --export-id=card_$i --export-height=800 $svg + done + + # export the whole page + inkscape --export-png=$base.png --export-area-page --export-width=1024 --without-gui $svg +done +