Example: Image

Same name in other branches
  1. 7.x-1.x image_example/image_example.module \image_example

Demonstrates the basic use of image API.

This module demonstrates the use of new image effects including the following topics.

  • Demonstrates the use of hook_ENTITY_TYPE_delete() to update module specific variables when an image style is 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 how to theme an image using an image style.

See also

hook_image_effect_info_alter().

hook_ENTITY_TYPE_delete().

Parent topics

File

modules/image_example/image_example.module, line 10

Functions

Title Sort descending File name Summary
image_example_help modules/image_example/image_example.module Implements hook_help().
image_example_image_effect_info_alter modules/image_example/image_example.module Implements hook_image_effect_info_alter().

Classes

Title Sort descending File name Summary
ColorizeImageEffect modules/image_example/src/Plugin/ImageEffect/ColorizeImageEffect.php Colorizes an image resource.
ImageExampleTest modules/image_example/tests/src/Functional/ImageExampleTest.php Functional tests for the Image Example module.
StyleForm modules/image_example/src/Form/StyleForm.php Form for interacting with image styles.