Lines 3-13
Link Here
|
3 |
clear() |
3 |
clear() |
4 |
{ |
4 |
{ |
5 |
kill $! 2>/dev/null |
5 |
kill $! 2>/dev/null |
6 |
rm -f /tmp/aview$$.pgm 2>/dev/null |
6 |
rm -rf $tmpdir 2>/dev/null |
7 |
} |
7 |
} |
8 |
myconvert() |
8 |
myconvert() |
9 |
{ |
9 |
{ |
10 |
if anytopnm "$1" >/tmp/aview$$.pgm 2>/dev/null ; then |
10 |
if anytopnm "$1" >"$2" 2>/dev/null ; then |
11 |
exit |
11 |
exit |
12 |
elif convert -colorspace gray "$1" pgm:- 2>/dev/null ; then |
12 |
elif convert -colorspace gray "$1" pgm:- 2>/dev/null ; then |
13 |
exit |
13 |
exit |
Lines 56-63
Link Here
|
56 |
esac |
56 |
esac |
57 |
done |
57 |
done |
58 |
trap clear 0 |
58 |
trap clear 0 |
59 |
mkfifo /tmp/aview$$.pgm |
59 |
tmpdir=`mktemp -t -d` |
60 |
outfile=/tmp/aview$$.pgm |
60 |
outfile=$tmpdir/aview.pgm |
|
|
61 |
mkfifo $outfile |
61 |
echo "$filenames" | while read name; do |
62 |
echo "$filenames" | while read name; do |
62 |
if test -r "$name" ; then |
63 |
if test -r "$name" ; then |
63 |
case "$name" in |
64 |
case "$name" in |
Lines 66-75
Link Here
|
66 |
aaflip $options "$name" |
67 |
aaflip $options "$name" |
67 |
;; |
68 |
;; |
68 |
*) |
69 |
*) |
69 |
myconvert "$name" >/tmp/aview$$.pgm & |
70 |
myconvert "$name" "$outfile" >"$outfile" & |
70 |
pid=$! |
71 |
pid=$! |
71 |
PATH="$PATH:." |
72 |
PATH="$PATH:." |
72 |
aview $options /tmp/aview$$.pgm |
73 |
aview $options $outfile |
73 |
kill $pid 2>/dev/null |
74 |
kill $pid 2>/dev/null |
74 |
esac |
75 |
esac |
75 |
else |
76 |
else |