Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / image_styles_alter.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_styles_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/image_styles_alter.twig
new file mode 100644 (file)
index 0000000..0ee5ecd
--- /dev/null
@@ -0,0 +1,15 @@
+/**
+ * Implements hook_image_styles_alter().
+ */
+function {{ machine_name }}_image_styles_alter(&$styles) {
+  // Check that we only affect a default style.
+  if ($styles['thumbnail']['storage'] == IMAGE_STORAGE_DEFAULT) {
+    // Add an additional effect to the thumbnail style.
+    $styles['thumbnail']['effects'][] = array(
+      'name' => 'image_desaturate',
+      'data' => array(),
+      'weight' => 1,
+      'effect callback' => 'image_desaturate_effect',
+    );
+  }
+}