5 * Hooks related to image styles and effects.
14 * Alter the information provided in \Drupal\image\Annotation\ImageEffect.
17 * The array of image effects, keyed on the machine-readable effect name.
19 function hook_image_effect_info_alter(&$effects) {
20 // Override the Image module's 'Scale and Crop' effect label.
21 $effects['image_scale_and_crop']['label'] = t('Bangers and Mash');
25 * Respond to image style flushing.
27 * This hook enables modules to take effect when a style is being flushed (all
28 * images are being deleted from the server and regenerated). Any
29 * module-specific caches that contain information related to the style should
30 * be cleared using this hook. This hook is called whenever a style is updated,
31 * deleted, or any effect associated with the style is update or deleted.
33 * @param \Drupal\image\ImageStyleInterface $style
34 * The image style object that is being flushed.
36 function hook_image_style_flush($style) {
37 // Empty cached data that contains information about the style.
38 \Drupal::cache('mymodule')->deleteAll();
42 * @} End of "addtogroup hooks".