projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
From http://www.jwz.org/xscreensaver/xscreensaver-5.21.tar.gz
[xscreensaver]
/
hacks
/
vidwhacker
diff --git
a/hacks/vidwhacker
b/hacks/vidwhacker
index aa7deb3803e46f1914c315ebdf96427367cab748..80b16f6f263e6b75dc57b460e1e2d67d647a9e78 100755
(executable)
--- a/
hacks/vidwhacker
+++ b/
hacks/vidwhacker
@@
-1,5
+1,5
@@
#!/usr/bin/perl -w
#!/usr/bin/perl -w
-# vidwhacker, for xscreensaver. Copyright (c) 1998-20
05
Jamie Zawinski.
+# vidwhacker, for xscreensaver. Copyright (c) 1998-20
11
Jamie Zawinski.
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
@@
-21,7
+21,7
@@
use diagnostics;
use strict;
my $progname = $0; $progname =~ s@.*/@@g;
use strict;
my $progname = $0; $progname =~ s@.*/@@g;
-my $version = q{ $Revision: 1.
28
$ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/;
+my $version = q{ $Revision: 1.
32
$ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/;
my $verbose = 0;
my $use_stdin = 0;
my $verbose = 0;
my $use_stdin = 0;
@@
-326,6
+326,7
@@
sub get_ppm() {
my $fn = `$cmd`;
$fn =~ s/\n$//s;
error ("didn't get a file?") if ($fn eq "");
my $fn = `$cmd`;
$fn =~ s/\n$//s;
error ("didn't get a file?") if ($fn eq "");
+ $fn = "$imagedir/$fn" unless ($fn =~ m@^/@s);
print STDERR "$progname: selected file $fn\n" if ($verbose > 1);
print STDERR "$progname: selected file $fn\n" if ($verbose > 1);
@@
-378,7
+379,7
@@
sub dispose_ppm($) {
} else {
my $tmpdir = $ENV{TMPDIR};
$tmpdir = "/tmp" unless $tmpdir;
} else {
my $tmpdir = $ENV{TMPDIR};
$tmpdir = "/tmp" unless $tmpdir;
- my $fn = sprintf ("%s/vidwhacker-%08x", $tmpdir, rand(0xFFFFFFFF));
+ my $fn = sprintf ("%s/vidwhacker-%08x
.ppm
", $tmpdir, rand(0xFFFFFFFF));
local *OUT;
unlink $fn;
push @all_tmpfiles, $fn;
local *OUT;
unlink $fn;
push @all_tmpfiles, $fn;
@@
-451,7
+452,7
@@
sub usage() {
sub main() {
while ($_ = $ARGV[0]) {
shift @ARGV;
sub main() {
while ($_ = $ARGV[0]) {
shift @ARGV;
- if (
$_ eq "--verbose"
) { $verbose++; }
+ if (
m/^--?verbose$/
) { $verbose++; }
elsif (m/^-v+$/) { $verbose += length($_)-1; }
elsif (m/^(-display|-disp|-dis|-dpy|-d)$/) { $ENV{DISPLAY} = shift @ARGV; }
elsif (m/^--?stdin$/) { $use_stdin = 1; }
elsif (m/^-v+$/) { $verbose += length($_)-1; }
elsif (m/^(-display|-disp|-dis|-dpy|-d)$/) { $ENV{DISPLAY} = shift @ARGV; }
elsif (m/^--?stdin$/) { $use_stdin = 1; }
@@
-479,6
+480,12
@@
sub main() {
read_config;
read_config;
+ # sanity checking - is pbm installed?
+ # (this is a non-exhaustive but representative list)
+ foreach ("ppmtopgm", "pgmenhance", "pnminvert", "pnmarith", "pnmdepth") {
+ which ($_) || error "$_ not found on \$PATH.";
+ }
+
if (!$use_stdout) {
$_ = `xdpyinfo 2>&-`;
($screen_width) =~ m/ dimensions: +(\d+)x(\d+) pixels/;
if (!$use_stdout) {
$_ = `xdpyinfo 2>&-`;
($screen_width) =~ m/ dimensions: +(\d+)x(\d+) pixels/;