- if (-z $tmpfile)
- {
- unlink $tmpfile;
- error "\"$cmd\" produced no data.";
- }
-
- if ($use_stdout) {
- local *IN;
- my $ppm = "";
- my $reader = "<$tmpfile";
-
- # horrid kludge for SGIs, since they don't use PPM...
- if ($displayer eq "vidtomem") {
- $reader = "sgitopnm $tmpfile";
- $reader .= " 2>/dev/null" if ($verbose <= 1);
- $reader .= " |";
- }
-
- open(IN, $reader) || error "reading $tmpfile: $!";
- print STDERR "$progname: reading $tmpfile\n" if ($verbose > 1);
- while (<IN>) { $ppm .= $_; }
- close IN;
- unlink $tmpfile;
- print STDOUT $ppm;
-
- } else {
-
- $cmd = "xscreensaver-getimage-file";
- $cmd .= " --verbose" if ($verbose);
- $cmd .= " $tmpfile";
-
- print STDERR "$progname: executing \"$cmd\"\n" if ($verbose);
- system ($cmd);
-