Search code examples
drupaldrupal-7thumbnails

Unable to generate the derived image using image_style_url


Im seeing the following message within Reports when I attempt to use the image_style_url function on an image : "Unable to generate the derived image located at public://..."

I have ensured that the directory is under Apache's ownership and I have no problems attaching images for upload to other nodes.

The style name "template" has been set up within the "Image Styles" menu in the Drupal Administration panel.

When the function is called, an image URL is being returned but the image is not displaying because the image is not being created by the server.

Does anyone have any ideas as to how I can fix this issue?

I am simply printing image_style_url, where "thumbnail" is a name given to the image style that was created in the admin area.

$img_url = $node->field_image[0]['uri'];
print image_style_url("thumbnail", $img_url);

Solution

  • I just had had this problem generating sites/default/files/styles/newsletter_thumbnail/public/Scotland_bankers_2.jpg - it turned out that the file Scotland_bankers_2.jpg didn't exist in the /files/ folder so there was nothing to generate!