Use image scale and crop in custom function In Drupal 7, I'm trying to use image_scale_and_crop() to take an image from an external URL and resize it.  Then I want to print it out to my page.  Here is my code:

$filename = $bjt_img;
$img_url = "http://www.mydomain.com/uploads/".$filename;
$myimg = image_load($img_url);
$myimg_scaled = image_scale_and_crop($myimg, 100, 80);

print '&lt;img src="'.$myimg_scaled.'"&gt;'


I'm getting the message:


  Recoverable fatal error: Argument 1 passed to image_scale_and_crop()
  must be an instance of stdClass, boolean given, called in...


How exactly is the image returned with image_scale_and_crop()?
You problem is image_load($img_url) is returning FALSE, which is not an object.   

$filename = $bjt_img;
$img_url = "http://www.mydomain.com/uploads/".$filename;
if (isset($myimg = image_load($img_url)) {
  $myimg_scaled = image_scale_and_crop($myimg, 100, 80);
  print '&lt;img src="'.$myimg_scaled.'"&gt;'
} 
else {
  print 'error'
}


Plus I think it must be a file,  not a url to a file