.key base/a,from/a,to/a,width/a,height/a
.bra {
.ket }

echo >env:mpic2iff {from}

lab start_loop

echo "*NProcessing... {base}$mpic2iff.[YUV]*N"

cyuv2ppm {base}$mpic2iff ram:mpic_temp -iw {width} -ih {height}
ppmtoilbm >{base}$mpic2iff.iff -hamif ram:mpic_temp
delete "{base}$mpic2iff.?"
delete ram:mpic_temp quiet

eval >NIL: $mpic2iff + 1 TO=t:temp
type >env:mpic2iff t:temp

if VAL $mpic2iff NOT GT {to}
  skip start_loop back
endif

delete env:mpic2iff t:temp quiet
echo "*NDone!"
