You are here

README.txt in ImageCache 6.2

Same filename and directory in other branches
  1. 5.2 README.txt
  2. 5 README.txt
ImageCache is a dynamic image manipulation and cache tool. It allows you to
create a namespace that corresponds to a set of image manipulation actions. It
generates a derivative image the first time it is requested from a namespace
until the namespace or the entire imagecache is flushed.

Getting Started:

1. Upload and enable both the ImageCache and ImageCache UI modules.

2. Go to Administer -> Site Building -> ImageCache. Click on the local task tab
labeled "Add New Preset" to build a new set of image manipulation actions.

3. Enter a descriptive name of your choice (e.g. 'product_thumbnail') into the
"Preset Namespace" box and click "Create New Preset".

4. Add actions to your preset that tell ImageCache how to manipulate the
original image when it is rendered for display. Available actions include
crop, scale, desaturate (grey scale), resize, and rotate. Multiple actions
may be added to a preset.

5. Each action is configured in its own form, and the actions may be reordered
from the preset's configuration form. If you need to make any changes to the
order of actions in a preset, remember to click "Update Preset" when you're
finished.

Viewing Manipulated Images:

Your modified image can be viewed by visiting a URL in this format:

http://example.com/files/imagecache/preset-name/files/image-name.jpg

For example, if your preset is named 'product_thumbnail' and your image is
named 'green-widget.jpg', you could view your modified image at:

http://example.com/files/imagecache/product_thumbnail/files/green-widget...

NOTE: Each role that wishes to view the images generated by a
particular preset must be given permission on the admin/user/permissions
page.

ImageCache also defines a theme function that you can use in your modules and
themes to automatically display a manipulated image. For example, to use the
theme function in a .tpl.php file, add the following line where you would like
the image to appear:

<?php
print theme('imagecache', 'preset_namespace', $image_filepath, $alt, $title, $attributes);
?>

Change 'preset_namespace' to the name of your imagecache preset and make sure
that $image_filepath or some other variable contains the actual filepath to
the image you would like to display.

$alt, $title and $attributes are optional parameters that specify ALT/TITLE
text for the image element in the HTML or other attributes as specified in the
$attributes array.

Using ImageCache with Contributed Modules:

ImageCache presets can be put to use in various other modules. For example, when
using CCK with the Imagefield module, you can use the "Display fields" local
task tab to choose a preset to apply to images in that field. Similarly, you
can specify a preset when displaying images attached to nodes using Imagefield
in a View through the Views UI.

For more information, refer to http://drupal.org/node/163561.

(Images, page names, and form field names may refer to previous versions of
ImageCache, but the concepts are the same.)

File

README.txt
View source
  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.
  5. Getting Started:
  6. 1. Upload and enable both the ImageCache and ImageCache UI modules.
  7. 2. Go to Administer -> Site Building -> ImageCache. Click on the local task tab
  8. labeled "Add New Preset" to build a new set of image manipulation actions.
  9. 3. Enter a descriptive name of your choice (e.g. 'product_thumbnail') into the
  10. "Preset Namespace" box and click "Create New Preset".
  11. 4. Add actions to your preset that tell ImageCache how to manipulate the
  12. original image when it is rendered for display. Available actions include
  13. crop, scale, desaturate (grey scale), resize, and rotate. Multiple actions
  14. may be added to a preset.
  15. 5. Each action is configured in its own form, and the actions may be reordered
  16. from the preset's configuration form. If you need to make any changes to the
  17. order of actions in a preset, remember to click "Update Preset" when you're
  18. finished.
  19. Viewing Manipulated Images:
  20. Your modified image can be viewed by visiting a URL in this format:
  21. http://example.com/files/imagecache/preset-name/files/image-name.jpg
  22. For example, if your preset is named 'product_thumbnail' and your image is
  23. named 'green-widget.jpg', you could view your modified image at:
  24. http://example.com/files/imagecache/product_thumbnail/files/green-widget...
  25. NOTE: Each role that wishes to view the images generated by a
  26. particular preset must be given permission on the admin/user/permissions
  27. page.
  28. ImageCache also defines a theme function that you can use in your modules and
  29. themes to automatically display a manipulated image. For example, to use the
  30. theme function in a .tpl.php file, add the following line where you would like
  31. the image to appear:
  32. print theme('imagecache', 'preset_namespace', $image_filepath, $alt, $title, $attributes);
  33. ?>
  34. Change 'preset_namespace' to the name of your imagecache preset and make sure
  35. that $image_filepath or some other variable contains the actual filepath to
  36. the image you would like to display.
  37. $alt, $title and $attributes are optional parameters that specify ALT/TITLE
  38. text for the image element in the HTML or other attributes as specified in the
  39. $attributes array.
  40. Using ImageCache with Contributed Modules:
  41. ImageCache presets can be put to use in various other modules. For example, when
  42. using CCK with the Imagefield module, you can use the "Display fields" local
  43. task tab to choose a preset to apply to images in that field. Similarly, you
  44. can specify a preset when displaying images attached to nodes using Imagefield
  45. in a View through the Views UI.
  46. For more information, refer to http://drupal.org/node/163561.
  47. (Images, page names, and form field names may refer to previous versions of
  48. ImageCache, but the concepts are the same.)