In Drupal 6, a module called Imagecache allowed developers to create custom styles to dynamically manipulate an image. We typically use Imagecache to scale and crop images to specific dimensions, but Imagecache can rotate images, deal with opacity, add borders, change colors and even change file formats.
With the release of Drupal 7, Imagecache was brought into the core and renamed “Image styles”. With that change (and others dealing with the file system), the code to render the image also changed.
Here’s the Drupal 6 way with Imagecache:
print theme('imagecache', 'imagecache_style_name', 'path/to/image.jpg', 'alt_text', 'title');
Here’s the Drupal 7 way with Image styles:
print theme('image_style', array('style_name' => 'image_style_name', 'path' => 'path/to/image.jpg'))
Your variables will go into the italicized spots.
Imagecache and Image styles also integrates with Views. So if you don’t want to mess with the code, you can always use Views.
Since that was so quick and easy, spend the rest of the time you would’ve been stuck working on that and watch this video of my fellow web dev Scott: