use strict;
my $progname = $0; $progname =~ s@.*/@@g;
-my $version = q{ $Revision: 1.19 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/;
+my $version = q{ $Revision: 1.20 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/;
my $verbose = 0;
my $use_stdin = 0;
# "xsri -scale -keep-aspect -center-horizontal -center-vertical",
);
+# apparently some versions of netpbm call it "pamoil" instead of "pgmoil"...
+#
+my $pgmoil = (which("pamoil") ? "pamoil" : "pgmoil");
+
# List of interesting PPM filter pipelines.
# In this list, the following magic words may be used:
my @filters = (
"ppmtopgm FILE1 | pgmedge | pgmtoppm COLORS | ppmnorm",
"ppmtopgm FILE1 | pgmenhance | pgmtoppm COLORS",
- "ppmtopgm FILE1 | pgmoil | pgmtoppm COLORS",
+ "ppmtopgm FILE1 | $pgmoil | pgmtoppm COLORS",
"ppmtopgm FILE1 | pgmbentley | pgmtoppm COLORS",
"ppmrelief FILE1 | ppmtopgm | pgmedge | ppmrelief | ppmtopgm |" .
" pnmflip -tb FILE3 | ppmnorm > FILE2 ; " .
" pnmarith -multiply FILE1 FILE2",
- "ppmshift 30 FILE1 | ppmtopgm | pgmoil | pgmedge | " .
+ "ppmshift 30 FILE1 | ppmtopgm | $pgmoil | pgmedge | " .
" pgmtoppm COLORS > FILE2 ; " .
" pnmarith -difference FILE1 FILE2",
}
+# returns the full path of the named program, or undef.
+#
+sub which {
+ my ($prog) = @_;
+ foreach (split (/:/, $ENV{PATH})) {
+ if (-x "$_/$prog") {
+ return $prog;
+ }
+ }
+ return undef;
+}
+
+
# Choose random foreground and background colors
#
sub randcolors {