Example: Image in Examples for Developers 7
Demonstrates the basic use of image API.
This module demonstrates the use of Drupal 7's new image styles and effects including the following topics.
- Define default image styles in code. Useful for modules that want to ship with predefined image styles and for site developers who want their image style configurations to be in version control. hook_image_default_styles().
- Define new image effects. Demonstrates how a module can add additional effects to the options available when creating image styles. hook_image_effect_info().
- Alter existing image styles. Demonstrates the use of hook_image_styles_alter() to modify existing image effects, especially those defined by other modules in hook_image_default_styles() without having to override the styles.
- Demonstrates the use 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 field of type #managed_file that allows the user to upload an image and choose a style to use when displaying that image.
- Demonstrates the use of theme_image_style() to display images using an image style.
See also
Parent topics
File
- image_example/
image_example.module, line 8 - Module file for image_example
Functions
Classes
Name | Location | Description |
---|---|---|
ImageExampleTestCase |
image_example/ |
Functional tests for the Image Example module. |