5 * Provides Image module hook implementations for testing purposes.
8 use Drupal\image\ImageStyleInterface;
10 function image_module_test_file_download($uri) {
11 $default_uri = \Drupal::state()->get('image.test_file_download') ?: FALSE;
12 if ($default_uri == $uri) {
13 return ['X-Image-Owned-By' => 'image_module_test'];
18 * Implements hook_image_effect_info_alter().
20 * Used to keep a count of cache misses in \Drupal\image\ImageEffectManager.
22 function image_module_test_image_effect_info_alter(&$effects) {
23 $image_effects_definition_called = &drupal_static(__FUNCTION__, 0);
24 $image_effects_definition_called++;
28 * Implements hook_image_style_presave().
30 * Used to save test third party settings in the image style entity.
32 function image_module_test_image_style_presave(ImageStyleInterface $style) {
33 $style->setThirdPartySetting('image_module_test', 'foo', 'bar');