about summary refs log tree commit diff
path: root/editor/ppmquant
diff options
context:
space:
mode:
Diffstat (limited to 'editor/ppmquant')
-rwxr-xr-xeditor/ppmquant30
1 files changed, 30 insertions, 0 deletions
diff --git a/editor/ppmquant b/editor/ppmquant
new file mode 100755
index 00000000..11bce6d2
--- /dev/null
+++ b/editor/ppmquant
@@ -0,0 +1,30 @@
+#!/usr/bin/perl -w
+##############################################################################
+#  This is nothing but a compatibility interface for Pnmquant.
+#  An old program coded to call Ppmquant will continue working because
+#  this interface exists.  All new (or newly modified) programs should
+#  call Pnmquant or Pnmremap instead.
+#
+#  In days past, Pnmquant and Pnmremap did not exist.  Ppmquant did
+#  the job of both Pnmremap and Pnmquant, but only on PPM images.
+##############################################################################
+
+use strict;
+
+use Getopt::Long;
+
+my $TRUE=1; my $FALSE = 0;
+
+my @ppmquantArgv = @ARGV;
+
+Getopt::Long::Configure('pass_through');
+
+my $validOptions = GetOptions('mapfile' => \my $mapfileopt);
+
+my $mapfileOptionPresent = ($validOptions && $mapfileopt);
+
+if ($mapfileOptionPresent) {
+    system('pnmremap', @ppmquantArgv);
+} else {
+    system('pnmquant', @ppmquantArgv);
+}