From 43b3985bd28d5fa5e344bef23cd1e3e3d082afa2 Mon Sep 17 00:00:00 2001
From: Dane Powell <git@danepowell.com>
Date: Mon, 13 Apr 2015 15:25:06 -0500
Subject: [PATCH] Issue #2148453 by Dane Powell: Fixed image styles not
 reverting.

---
 includes/features.image.inc | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/includes/features.image.inc b/includes/features.image.inc
index b2058b7..cefc3fc 100644
--- a/includes/features.image.inc
+++ b/includes/features.image.inc
@@ -73,13 +73,16 @@ function image_features_export_render($module_name, $data, $export = NULL) {
  */
 function image_features_revert($module) {
   if ($default_styles = features_get_default('image', $module)) {
-    foreach (array_keys($default_styles) as $default_style) {
-      if ($style = image_style_load($default_style)) {
-        if ($style['storage'] != IMAGE_STORAGE_DEFAULT) {
-          image_default_style_revert($style);
-        }
+    foreach ($default_styles as $default_style_name => $default_style) {
+      if ($style = image_style_load($default_style_name)) {
+        image_default_style_revert($style);
+        image_default_style_save($default_style);
       }
     }
+    if (!$child && !empty($style['effects'])) {
+      // Sanitize Effect ID's (ieid)
+      $style['effects'] = array_values($style['effects']);
+    }
   }
 }
 
-- 
2.1.0

