Imagecache is a Drupal Module to develop presets for the images. The Imagecache module helps you to create copies of the same images in different sizes. You can upload any image to Drupal and use it with the Imagecache Module. Usually this module requires a library that manipulates images such as the GD2 or the ImageMagick. You should also enable the clean URL’s for the Imagecache Module. Most commonly, Imagecache Module is used in combination with the Imagefield and CCK Modules of Drupal.
Just like any other application, the Drupal Imagecache also has certain prerequisites before you start working with the module. The basic requirements are listed below:
- ImageAPI Module: Installing and enabling the ImageAPI Module is necessary as it provides the API from image.inc. This module also distributes the support of GD2 and ImageMagick for the other modules.
- ImageAPI Toolkit: In addition to the ImageAPI Module, you also need an ImageAPI Toolkits installed before using the Imagecache Module.
- Clean URLs: You need the support of clean URL or of private files for the Imagecache to create folders and files.
Functions and Methods of Imagecache
This Functions and Methods of Imagecache section will introduce you to some of the module functions and their descriptions. Some of them are listed here:
- imagecache_generate_action: Generates the image presets for a particular preset or node.
- imagecache_flush_action: Flushes all the image presets available for a particular node.
- imagecache_build_deriative: Creates a new image on the basis of an available image preset.
- imagecache_image_flush: Flushes all the cached versions of a particular file in all the presets available.
- imagecache_preset_save: Saves a specified Imagecache preset.
- imagecache_presets: Retrieves an array of all the available image presets along with their settings.
- imagecache_get_images_in_node: Retrieves all the images associated with a particular node.
- theme_imagecache: Creates an image tag for a particular derivative of Imagecache.
- imagecache_system_file_system_submit: Ensures that the correct files directory is called back by rebuilding the menus.
Some of the Constant that are used in handling this Module are listed below:
- IMAGECACHE_STORAGE_DEFAULT: Use this Imagecache storage constant for the entire module defined; default presets available in the code.
- IMAGECACHE_STORAGE_NORMAL: Use this Imagecache storage constant for the presets in the database defined by the users.
- IMAGECACHE_STORAGE_OVERRIDE: Use this Imagecache storage constant for the presets defined by users that override the default presets of the module.
Other Related Modules
The various modules that are related to the Drupal’s Imagecache Module are listed and briefly explained below:
- ImageCache Profiles: The ImageCache Profiles Module allows you to set pictures for your user profiles. It also allows you to use the avatars on the profile pages, comments and nodes in varied sizes.
- Taxonomy Image: The Taxonomy Image Module allows you to associate the images with the taxonomy terms. You can create both the on-to-one and many-to-one term-to-image relationships.
- Imagecache Actions: The Imagecache Actions Module provides advanced and additional image setting and image styles for your image presets. Some of the effects include Watermarking, Color-shifting, Canvas manipulation, Overlays, Text overlay and many more.
- ImageField Focus: The ImageField Focus is yet another module that helps you to scale and crop the image presets. This Module also creates an extension to the ImageFields Image Widget without the need of a separate widget.
- ImageCache External: The ImageCache External Module allows you to associate the external images with the ImageCache of Drupal6 or Image Derivatives in Drupal 7.
- Transliteration: The Transliteration Module prevents the difficulties with the file names by removing all the unwanted spaces and characters. This module transliterates in a one-way direction.
- ImageMagick raw action: The ImageMagick raw action is a module that allows you to customize the actions of ImageMagick Module. This module allows you to handle the options of command line in an advanced way.
- Ubercart: The Ubercart Module is a wonderful e-commerce site offered by Drupal. You can sell your products easily through this module.
- iTweak Upload: The iTweak Upload Module automatically enhances the upload forms of both Drupal Core and Comments. This Module allows you to work with the themes independently.
The Drupal Imagecache Module is definitely a must try Module. You can create the various preset images and customize them according to your taste, with the help of the various other Drupal Modules that integrate well with the Drupal Imagecache Module. For all those of you using Drupal 7, it is a good news as the Imagecache Module has been moved into the Core of Drupal 7. GreenGeeks uses optimized servers to enhance the performance of your web hosting, click here to learn more.