Demonstrates the basic use of image API.

This module demonstrates the use of Backdrop's 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

hook_image_default_styles().

hook_image_effect_info().

hook_image_style_save().

hook_image_style_delete().

theme_image_style().

Parent topics

File

modules/examples/image_example/image_example.module, line 8
Module file for image_example

Functions

Namesort ascending Location Description
theme_image_example_image modules/examples/image_example/image_example.pages.inc Theme function displays an image rendered using the specified style.
theme_image_example_colorize_summary modules/examples/image_example/image_example.module Formats a summary of an image colorize effect.
image_example_theme modules/examples/image_example/image_example.module Implements hook_theme().
image_example_style_form_validate modules/examples/image_example/image_example.pages.inc Verifies that the user supplied an image with the form..
image_example_style_form_submit modules/examples/image_example/image_example.pages.inc Form Builder; Display a form for uploading an image.
image_example_style_form modules/examples/image_example/image_example.pages.inc Form for uploading and displaying an image using selected style.
image_example_style_flush modules/examples/image_example/image_example.module Implements hook_image_style_flush().
image_example_menu modules/examples/image_example/image_example.module Implements hook_menu().
image_example_install modules/examples/image_example/image_example.install Implements hook_install().
image_example_image_style_save modules/examples/image_example/image_example.module Implements hook_image_style_save().
image_example_image_style_delete modules/examples/image_example/image_example.module Implements hook_image_style_delete().
image_example_image_styles_alter modules/examples/image_example/image_example.module Implements hook_image_styles_alter().
image_example_image_effect_info modules/examples/image_example/image_example.module Implements hook_image_effect_info().
image_example_image_default_styles modules/examples/image_example/image_example.module Implements hook_image_default_styles().
image_example_enable modules/examples/image_example/image_example.install Implements hook_enable().
image_example_disable modules/examples/image_example/image_example.install Implements hook_disable().
image_example_config_info modules/examples/image_example/image_example.module Implements hook_config_info().
image_example_colorize_form modules/examples/image_example/image_example.module Form Builder; Configuration settings for colorize effect.
image_example_colorize_effect modules/examples/image_example/image_example.module Image effect callback; Colorize an image resource.

Classes

Namesort ascending Location Description
ImageExampleTestCase modules/examples/image_example/image_example.test Functional tests for the Image Example module.