in reply to img2txt

i tried this script and i get an error "substr outside of string at img2txt.pl line 102"