Commit 74f0354f authored by Dries's avatar Dries

- Patch #927138 by rasmusluckow, douggreen, marcingy, h4rrydog, swing4cat:...

- Patch #927138 by rasmusluckow, douggreen, marcingy, h4rrydog, swing4cat: Fail image generation with 404 instead of 500, when source file is missing.
parent de571884
......@@ -745,6 +745,12 @@ function image_style_deliver($style, $scheme) {
}
}
// Don't try to generate file if source is missing.
if (!file_exists($image_uri)) {
watchdog('image', 'Unable to generate the derived image from image at %path.', array('%path' => $derivative_uri));
return new Response(t('Error generating image, missing source file.'), 404);
}
// Don't start generating the image if the derivative already exists or if
// generation is in progress in another thread.
$lock_name = 'image_style_deliver:' . $style['name'] . ':' . drupal_hash_base64($image_uri);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment