I want to create a new image style in Drupal 7, with a name like front_video_thumbnail. I want to use this size image on front page. I wrote code in template.php preprocess_page(), like the following one.

$img = theme('image_style', array('style_name' => 'front_video_thumnail', 'path' => $value['uri']));
$content =l($img, $node_url, array('html' => TRUE));

No image is showing, because no image has been created in the new style folder.

How can I make this new image style created in the style folder?

  • check whether $value['uri'] has the correct path to the image, also verify admin/reports/dblog for any warnings and errors related to image style – Dinesh Kumar Sarangapani Oct 26 '12 at 4:41

You have to go to Configuration => Image Styles. Create the Image Style with the name front_video_thumnail and once it's configuration is saved your code should work.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.