chiark / gitweb /
Work around Inkscape command-line breaking change.
[chroma-debian.git] / resources / inkscape_export.pm
diff --git a/resources/inkscape_export.pm b/resources/inkscape_export.pm
new file mode 100644 (file)
index 0000000..7e0545e
--- /dev/null
@@ -0,0 +1,13 @@
+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;