class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
You should be able to use a line break. Make sure that your negative margin you set in $foo->image_crop is enough for two lines. Use something like 20 pixels, and you should be able to see the two lines.
Also, make sure that your string is enclosed in double quotes, not single quotes, otherwise the line break will not be interpreted. For instance:
$foo->image_crop = '0 0 -22 0';
$foo->image_text = "some text here\na new line";
Also, make sure that your string is enclosed in double quotes, not single quotes, otherwise the line break will not be interpreted. For instance: