merge the formfield patch from ooo-build
[ooovba.git] / ooo_custom_images / industrial / res / commandimagelist / frobnicate-icons.php
blob27ac7a2295a35bbbfad870dd6b66d3c7d2eea826
1 #!/usr/bin/php4
2 <?php
3 #$renderer = "rsvg";
4 $renderer = "inkscape";
6 /*
8 If you're a hacker, please look away
12 $render_sizes = array("16"=>"sc_","24"=>"lc_");
13 $render_dpis = array("16"=>"60", "24"=>"90");
15 $svgs = `find . -name "*.svg"`;
16 $svgs = explode("\n",$svgs);
18 echo "* rendering PNGs\n\n";
19 foreach ($svgs as $line) {
20 if ($line) {
21 $file = eregi_replace("^./lc_(.*)\.svg","\\1",$line);
22 //echo "\n" . $file . "\n\n";
23 foreach ($render_sizes as $size => $prefix) {
24 $SVG = "lc_$file.svg";
25 $PNG = "$prefix$file.png";
26 //delete older version
27 if (file_exists($PNG)) unlink($PNG);
28 echo "$SVG => $PNG\n";
29 if ($renderer == "inkscape") {
30 $exec = "inkscape -z -e $PNG -f $SVG ";
31 $exec .="-w $size -h $size";
32 exec($exec);
33 } else {
34 exec("rsvg -w $size -h $size $SVG $PNG\n");
40 exit;