TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
Using image library with remote images
  • Is there not a way to use the Image library for remote images? This code:


    Image::factory('http://images.df2.com/def_134x179.jpg');


    produces a 'Invalid image or not a valid image' exception. I can access the image via a browser though. Have I missed anything?
  • You need to download it to the local server first, something like `file_put_contents(file_get_contents($remote), $local)`.
  • I am using a subdomain for the image on the same server. Will that not do?
  • You should be able to access it locally then, without URL.
  • Or if you can't access it locally then use Remote::get(), save image to temporary file and do whatever you wish with it.
  • You said it's on the same server right? Shouldn't you access it by using the path to the file instead of the URL?

    You'll want to know the path to your images subdomain / folder.


    Image::factory('/path/to/subdomain/def_134x179.jpg');