This example demonstrates the basic usage of the image API.
This module demonstrates the use of image styles and effects, including the following topics.
- Demonstrate how a module can add additional effects to the options available when creating image styles.
- Demonstrate the usage of hook_image_styles_alter() to modify existing image effects without having to override the styles.
- Demonstrate the usage of hook_image_style_save() and hook_image_style_delete() to update module specific variables when an image style is either re-named or deleted.
- Generate a form with a #managed_file field which allows users to upload an image and choose a style to display that image.
- Demonstrate the usage of theme_image_style() to display images using an image style.
See also
Parent topics
File
- modules/
examples/ image_example/ image_example.module, line 7 - Hooks implementations for the Image Example module.
Functions
Name | Location | Description |
---|---|---|
image_example_install |
modules/ |
Implements hook_install(). |
image_example_enable |
modules/ |
Implements hook_enable(). |
image_example_disable |
modules/ |
Implements hook_disable(). |
image_example_config_info |
modules/ |
Implements hook_config_info(). |
image_example_menu |
modules/ |
Implements hook_menu(). |
image_example_image_style_save |
modules/ |
Implements hook_image_style_save(). |
image_example_image_style_delete |
modules/ |
Implements hook_image_style_delete(). |
image_example_style_flush |
modules/ |
Implements hook_image_style_flush(). |
image_example_image_styles_alter |
modules/ |
Implements hook_image_styles_alter(). |
image_example_image_effect_info |
modules/ |
Implements hook_image_effect_info(). |
image_example_colorize_form |
modules/ |
Form Builder; Configuration settings for colorize effect. |
image_example_colorize_effect |
modules/ |
Image effect callback; Colorize an image resource. |
image_example_theme |
modules/ |
Implements hook_theme(). |
theme_image_example_colorize_summary |
modules/ |
Formats a summary of an image colorize effect. |
image_example_style_form |
modules/ |
Form for uploading and displaying an image using selected style. |
image_example_style_form_validate |
modules/ |
Verifies that the user supplied an image with the form.. |
image_example_style_form_submit |
modules/ |
Form Builder; Display a form for uploading an image. |
theme_image_example_image |
modules/ |
Theme function displays an image rendered using the specified style. |
Classes
Name | Location | Description |
---|---|---|
ImageExampleTestCase |
modules/ |
Functional tests for the Image Example module. |