I doubt that you still need an answer, since this question is quite old, but here it is for reference in the future:
The error you received is the return wp_load_imagethat is being used wp_crop_image. wp_load_imageuses the php function file_exists, which must be passed the file path without a domain.
So,
$crop = wp_crop_image( $file, $dimensions[0], $dimensions[1], 0, 0, 250, 280,
null, "wp-content/uploads/2010/09/squares-wide.jpeg" );
would work.
Aside, wp_upload_bitsnot only the file is uploaded for you, it also returns the URL of the downloaded file.
If you call the wp_upload_bitssame way (where "file" is the name of the form input):
if ($_FILES["file"]["name"]!="") {
$uploaded_file = wp_upload_bits($_FILES["file"]["name"], null,
file_get_contents($_FILES["file"]["tmp_name"]));
}
, $uploaded_file['url'] $dir."/image.jpg". $uploaded_file['url'].
:
http://site.local/wp-content/uploads/2010/09/squares-wide.jpeg :
$dir = dirname($file);
$dir_substr = substr($dir, 18)
$crop = wp_crop_image( $file, $dimensions[0], $dimensions[1], 0, 0, 250, 280,
null, $dir."/squares-wide.jpeg" );
, , , wp_uload_bits, ( , WP Custom , , part $uploaded_file = wp_upload_bits(...), wp_upload_bits ),
$file_uri = substr($uploaded_file['url'], 18);
$crop = wp_crop_image( $file, $dimensions[0], $dimensions[1], 0, 0, 250, 280,
null, $file_uri );