Index: wp-includes/class-wp-image-editor-imagick.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-includes/class-wp-image-editor-imagick.php	(revision )
+++ wp-includes/class-wp-image-editor-imagick.php	(revision )
@@ -175,7 +175,34 @@
 			return $updated_size;
 		}
 
-		return $this->set_quality();
+        $exif = exif_read_data($this->file);
+        if($exif) {
+            $orientation = 0;
+
+            if(!$orientation && isset($exif["Orientation"]))
+                $orientation = $exif["Orientation"];
+
+            if(!$orientation && isset($exif["IFD0"]) && isset($exif["IFD0"]["Orientation"]))
+                $orientation = $exif["IFD0"]["Orientation"];
+
+            if(!$orientation && isset($exif["COMPUTED"]) && isset($exif["COMPUTED"]["Orientation"]))
+                $orientation = $exif["COMPUTED"]["Orientation"];
+
+
+            switch($orientation) {
+                case 3:
+                    $this->rotate(180);
+                    break;
+                case 6:
+                    $this->rotate(-90);
+                    break;
+                case 8:
+                    $this->rotate(90);
+                    break;
+            }
+        }
+
+        return $this->set_quality();
 	}
 
 	/**
