[Clipart] Tasks for 'openclipart' package

Nicu Buculei nicu at apsro.com
Thu Jun 10 22:54:19 PDT 2004


fenix at theopencd.net wrote:
> Will the "batchsvgtopng" conversion tool work under Windows or DOS ?

ofcourse it will not work directly, but certainly it can be adapted in a 
.BAT file with the same functionality

let me to explain it, in order to help you understand and create one for 
Windows:

for i in *.svg; do inkscape -f "$i" -e "$i.png" -w 80; done

- for i in *.svg; [...]; done is parsing the current directory, 
searching for .SVG files;
- do inkscape -f "$i" -e "$i.png" -w 80 is calling for each file. -f 
"$i" specify the input file (like image1.svg) and -e "$i.png" specify 
the name of the exported png file (like image1.svg.png). the -w 80 
parameter is the width for exported file (i'm using this script to 
generate thumbnails)

you will have to:
- use the correct syntax for the "for" command, as requested by DOS 
batch files (don't ask me)
- instead of inkscape use inkscape.exe (or 
c:\progra~1\inkscape\inkscape.exe)

> I'm just a beginner in Linux, so getting this script to work will be nearly 
> impossible under Linux... (for me)

under Linux this script is working easily, with one single requirement: 
to have Inkscape installed.
you copy the script in one directory with .SVG images and launch it. all 
SVG files in the current directory will be exported as PNG with the 
desired size, following the naming scheme 'name.svg'->'name.svg.png'

see 'man inkscape' for additional command line parameters

-- 
nicu




More information about the clipart mailing list