From ced34cb15e095836767971aa4d27b141fb1d7ec9 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sat, 18 Oct 2014 08:47:54 -0400
Subject: [PATCH] Merge pull request #230 from bytesatwork-xx/master

---
 program/lib/Roundcube/rcube_image.php |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/program/lib/Roundcube/rcube_image.php b/program/lib/Roundcube/rcube_image.php
index c7a60e6..d0d0c74 100644
--- a/program/lib/Roundcube/rcube_image.php
+++ b/program/lib/Roundcube/rcube_image.php
@@ -229,10 +229,10 @@
                 $image = $new_image;
 
                 // fix rotation of image if EXIF data exists and specifies rotation (GD strips the EXIF data)
-                if (file_exists($this->image_file) ) {
+                if ($this->image_file && function_exists('exif_read_data')) {
                     $exif = exif_read_data($this->image_file);
                     if ($exif && $exif['Orientation']) {
-                        switch($exif['Orientation']) {
+                        switch ($exif['Orientation']) {
                             case 3:
                                 $image = imagerotate($image, 180, 0);
                                 break;

--
Gitblit v1.9.1