--- /dev/null
+our $inkscape_export_option = undef;
+
+sub inkscape_export {
+ my ($opts, $width, $height, $outfile, $infile) = @_;
+ unless (defined $inkscape_export_option) {
+ my $ver = `inkscape --version`;
+ $inkscape_export_option = ($ver =~ /Inkscape 0\./) ? "-e" : "-o";
+ }
+
+ system "inkscape $opts -w $width -h $height $inkscape_export_option $outfile $infile";
+}
+
+1;
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+require './inkscape_export.pm';
+
if($#ARGV != 1)
{
print STDERR "Usage: make-base-marble.pl <file.svg> <directory>\n";
$background = "";
# Use Inkscape to convert the SVG to a PNG
- system("inkscape $background -w $width_png -h $height_png -e $file_png $file_svg");
+ inkscape_export($background, $width_png, $height_png, $file_png, $file_svg);
}
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+require './inkscape_export.pm';
+
if($#ARGV != 1)
{
print STDERR "Usage: make-pieces-marble.pl <pieces.svg> <directory>\n";
$background = "-b \"#000000\"" if($partial);
# Use Inkscape to convert the SVG to a PNG
- system("inkscape $background -w $width_png -h $height_png -e $file_png $file_svg");
+ inkscape_export($background, $width_png, $height_png, $file_png, $file_svg);
for($piece = 0; $piece < $rows * $columns; $piece ++)
{
# Use blur-full for most pieces, blur-half for earth and earth_double, and
# blur-quarter for earth_directional, maps and teleport.
+require './inkscape_export.pm';
+
if($#ARGV != 0)
{
print STDERR "Usage: make-pieces-neon.pl <directory>\n";
$height_png = $height * ($columns * 2 + 1);
$file_png_base = "/tmp/chroma-pieces-base-$$.png";
- system("inkscape -w $width_png -h $height_png -e $file_png_base $file_svg_base");
+ inkscape_export("", $width_png, $height_png, $file_png_base, $file_svg_base);
$file_png_overlay = "/tmp/chroma-pieces-overlay-$$.png";
- system("inkscape -w $width_png -h $height_png -e $file_png_overlay $file_svg_overlay");
+ inkscape_export("", $width_png, $height_png, $file_png_overlay, $file_svg_overlay);
$file_png_overlay_double = "/tmp/chroma-pieces-double-$$.png";
- system("inkscape -w $width_png -h $height_png -e $file_png_overlay_double $file_svg_overlay_double");
+ inkscape_export("", $width_png, $height_png, $file_png_overlay_double, $file_svg_overlay_double);
$file_png_partial = "/tmp/chroma-pieces-partial-$$.png";
system("convert -compose overlay -composite $file_png_base $file_png_overlay $file_png_partial");
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+require './inkscape_export.pm';
if($#ARGV != 1)
{
$background = "-b \"#000000\"" if($partial);
# Use Inkscape to convert the SVG to a PNG
- system("inkscape $background -w $width_png -h $height_png -e $file_png $file_svg");
+ inkscape_export($background, $width_png, $height_png, $file_png, $file_svg);
for($piece = 0; $piece < $rows * $columns; $piece ++)
{
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+require './inkscape_export.pm';
+
if($#ARGV != 1)
{
print STDERR "Usage: make-wall-marble.pl <pieces.svg> <directory>\n";
$background = "";
# Use Inkscape to convert the SVG to a PNG
- system("inkscape $background -w $width_png -h $height_png -e $file_png $file_svg");
+ inkscape_export($background, $width_png, $height_png, $file_png, $file_svg);
}