If an image has a space in the filename, the "file_exists" check in adaptive_image_preprocess_image() returns false. This causes the "styles" URL - which regenerates the image - to be used as the image path, rather than the URL of the previously cached image. This is because the $derivative_uri is urlencoded at the time file_exists() tries to find the file.

Patch forthcoming.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jim_keller’s picture

attached patch is against the dev branch of 7.x-1.x.
Note that I've added a urldecode() around $derivative_uri, which seems to work. However, I didn't look into *why* the filepath is encoded. I'm not sure if that's the expected behavior for preprocess_image, but if not, it may be worthwhile to urldecode (or simply not urlencode) somewhere further up the chain.

Baysaa’s picture

Issue summary: View changes

In my local testing I have also found the file_exists() check gets passed a path with querystring attached to it (itok=XXXX) in adaptive_image_preprocess_image. This causes file_exists to fail as well. Removing the itok querystring makes file_exists return true again. This has been causing a lot of stress on our server as it was regenerating the images on every call. And to make matters worse Varnish isn't caching these images for some reason (this is probably a misconfiguration on our end).