The problem is the value returned from image_load(), which is the boolean FALSE
because the function is not able to load the image file.
Return value
An image object or FALSE
if there was a problem loading the file. The image object has the following properties:
- 'source' - The original file path.
- 'info' - The array of information returned by
image_get_info()
- 'toolkit' - The name of the image toolkit requested when the image was loaded.
As for the parameters accepted from the function, the first one is the path to the image file, which normally doesn't mean the URL of the image. Check also that in your PHP installation, the file functions are allowed to open remote files; in the case it is not enabled, passing a URL when a function is expecting a file name would cause the error you noticed.
The documentation for imagecreatefromjpeg(), which is the function that is called if the image toolkit Drupal is using is GD2, and the image is a JPEG one, reports:
A URL can be used as a filename with this function if the fopen wrappers have been enabled. See fopen() for more details on how to specify the filename. See the Supported Protocols and Wrappers for links to information about what abilities the various wrappers have, notes on their usage, and information on any predefined variables they may provide.
Similar warning is given for imagecreatefrompng(), and the other imagecreatefrom[image-type]()
functions.