Drupal 7 imagecache, theming images in templates

Creating images in your templates in drupal 7 is somewhat different, so here is the code


<?php
$hero_image = array(
  'style_name' => 'case_study_teaser',
  'path' => $image['uri'],
  'width' => '',
  'height' => '',
  'alt' => $image['alt'],
  'title' => $image['title'],
  );
print theme('image_style',$hero_image);

$img_url = 'public://myimagefolder/imgfilename.jpg';  // the orig image uri
$style = 'thumbnail';  // or any other custom image style you've created via /admin/config/media/image-styles
?>
<img src="<?php print image_style_url($style, $img_url) ?>>

For some more info, check examples here http://benbuckman.net/tech/11/04/how-render-image-fields-drupal-7