Currently Image Resize Filter uses the getimagesize() function to check the size of both local and remote images. However this requires that allow_url_fopen is set to On in php.ini. This is the default setting, but it's possible to turn off and make Image Resize Filter not work with remote images. Additionally, (as noted multiple times on http://php.net/getimagesize), using getimagesize() downloads the entire image to the server, checks the size, then discards it. This means that for every remote image, we're downloading it twice.

To solve both of these problems, we should retrieve the remote image via drupal_http_request when checking the image size, save it locally, then work from the local copy.

Comments

quicksketch’s picture

Status: Active » Closed (fixed)

Heh, despite just opening this issue, I'm going to merge it with #740724: Delete remote images from temp directory after resizing, since they're intertwined.