1 Imagecache is a dynamic image manipulation and cache tool. It allows you to
2 create a namespace that corresponds to a set of image manipulation actions. It
3 generates a derivative image the first time it is requested from a namespace
4 until the namespace or the entire imagecache is flushed.
7 Go to Administer -> Site Configuration -> Image cache
9 Add some actions to your preset. Possible actions include scale, resize, and
10 crop. Multiple actions can be applied to one ruleset.
12 Your modified image can be viewed by visiting a URL in this format:
13 http://example.com/files/imagecache/preset-name/files/image-name.jpg
15 For example, if your preset is named 'products' and your image is named
16 'green-widget.jpg', you could view your modified image at:
18 http://example.com/files/imagecache/products/files/green-widget.jpg
20 To automatically display your manipulated image add the following line to your
21 desired tpl.php file where you would like the image to appear:
24 print theme('imagecache', 'preset_namespace', $image['filepath'], $alt, $title, $attributes);
27 Change 'preset_namespace' to the name of your imagecache preset.
29 $alt, $title and $attributes are optional parameters.
31 If you are using Imagecache with the CCK Imagefield module, you might use
32 something like the following in your template for an imagecache preset called 'products':
35 print theme('imagecache', 'products', $node->field_product_photo[0]['filepath']);
38 See also this post for more information:
39 http://drupal.org/node/163561