#719508 by dreamdust, veracium and drewish: Update installation info on using lighttpd.
[project/imagecache.git] / README.txt
CommitLineData
e1bc2b25 1ImageCache is a dynamic image manipulation and cache tool. It allows you to
9d2e42c5
DP
2create a namespace that corresponds to a set of image manipulation actions. It
3generates a derivative image the first time it is requested from a namespace
a2605313 4until the namespace or the entire imagecache is flushed.
41b394b1 5
9d2e42c5
DP
6Getting Started:
7
e1bc2b25 81. Upload and enable both the ImageCache and ImageCache UI modules.
9d2e42c5 9
e1bc2b25 102. Go to Administer -> Site Building -> ImageCache. Click on the local task tab
9d2e42c5
DP
11labeled "Add New Preset" to build a new set of image manipulation actions.
12
133. Enter a descriptive name of your choice (e.g. 'product_thumbnail') into the
14"Preset Namespace" box and click "Create New Preset".
15
e1bc2b25 164. Add actions to your preset that tell ImageCache how to manipulate the
9d2e42c5
DP
17original image when it is rendered for display. Available actions include
18crop, scale, desaturate (grey scale), resize, and rotate. Multiple actions
19may be added to a preset.
20
215. Each action is configured in its own form, and the actions may be reordered
22from the preset's configuration form. If you need to make any changes to the
23order of actions in a preset, remember to click "Update Preset" when you're
24finished.
25
26Viewing Manipulated Images:
a2605313
DP
27
28Your modified image can be viewed by visiting a URL in this format:
9d2e42c5 29
a2605313
DP
30http://example.com/files/imagecache/preset-name/files/image-name.jpg
31
9d2e42c5
DP
32For example, if your preset is named 'product_thumbnail' and your image is
33named 'green-widget.jpg', you could view your modified image at:
34
35http://example.com/files/imagecache/product_thumbnail/files/green-widget...
a2605313 36
9cd351f6 37NOTE: Each role that wishes to view the images generated by a
38particular preset must be given permission on the admin/user/permissions
39page.
40
e1bc2b25 41ImageCache also defines a theme function that you can use in your modules and
9d2e42c5
DP
42themes to automatically display a manipulated image. For example, to use the
43theme function in a .tpl.php file, add the following line where you would like
44the image to appear:
505fd29e 45
a2605313 46<?php
9d2e42c5 47print theme('imagecache', 'preset_namespace', $image_filepath, $alt, $title, $attributes);
a2605313 48?>
505fd29e 49
9d2e42c5
DP
50Change 'preset_namespace' to the name of your imagecache preset and make sure
51that $image_filepath or some other variable contains the actual filepath to
52the image you would like to display.
505fd29e 53
9d2e42c5
DP
54$alt, $title and $attributes are optional parameters that specify ALT/TITLE
55text for the image element in the HTML or other attributes as specified in the
56$attributes array.
505fd29e 57
e1bc2b25 58Using ImageCache with Contributed Modules:
505fd29e 59
e1bc2b25 60ImageCache presets can be put to use in various other modules. For example, when
9d2e42c5
DP
61using CCK with the Imagefield module, you can use the "Display fields" local
62task tab to choose a preset to apply to images in that field. Similarly, you
63can specify a preset when displaying images attached to nodes using Imagefield
64in a View through the Views UI.
65
66For more information, refer to http://drupal.org/node/163561.
41b394b1 67
9d2e42c5 68(Images, page names, and form field names may refer to previous versions of
e1bc2b25 69ImageCache, but the concepts are the same.)