ZZ
idx=0
IFS=$nl
for f in $good_fs
do
hxv=`SizeOf "$f"`
MsgIfV image $f has size $hxv
h=`echo $hxv | awk -Fx '{print $1}'`
v=`echo $hxv | awk -Fx '{print $2}'`
m_f=`PreviewMOf $f`
m_hxv=`SizeOf "$m_f"`
MsgIfV medium sized image $m_f has size $m_hxv
m_h=`echo $m_hxv | awk -Fx '{print $1}'`
m_v=`echo $m_hxv | awk -Fx '{print $2}'`
t_f=`PreviewTOf $f`
t_hxv=`SizeOf "$t_f"`
MsgIfV medium sized image $t_f has size $t_hxv
t_h=`echo $t_hxv | awk -Fx '{print $1}'`
t_v=`echo $t_hxv | awk -Fx '{print $2}'`
if [ "$medium_as_main" ]
then
main_f="$m_f"
main_sz="${m_v}x${m_h}"
else
main_f="$f"
main_sz="${v}x${v}"
fi
cat >> $index <
$f
ZZ
idx=`expr $idx + 1`
done
cat >> $index << ZZ