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 53-60
Link Here
|
53 |
esac |
53 |
esac |
54 |
done |
54 |
done |
55 |
trap clear 0 |
55 |
trap clear 0 |
56 |
mkfifo /tmp/aview$$.pgm |
56 |
tmpdir=`mktemp -t -d` |
57 |
outfile=/tmp/aview$$.pgm |
57 |
outfile=$tmpdir/aview.pgm |
|
|
58 |
mkfifo $outfile |
58 |
while [ $counter -gt 0 ]; do |
59 |
while [ $counter -gt 0 ]; do |
59 |
counter=$(($counter-1)) |
60 |
counter=$(($counter-1)) |
60 |
name=${filenames[$counter]} |
61 |
name=${filenames[$counter]} |
Lines 65-74
Link Here
|
65 |
aaflip $options "$name" |
66 |
aaflip $options "$name" |
66 |
;; |
67 |
;; |
67 |
*) |
68 |
*) |
68 |
myconvert "$name" >/tmp/aview$$.pgm & |
69 |
myconvert "$name" "$outfile" >"$outfile" & |
69 |
pid=$! |
70 |
pid=$! |
70 |
PATH="$PATH:." |
71 |
PATH="$PATH:." |
71 |
aview $options /tmp/aview$$.pgm |
72 |
aview $options $outfile |
72 |
kill $pid 2>/dev/null |
73 |
kill $pid 2>/dev/null |
73 |
esac |
74 |
esac |
74 |
else |
75 |
else |