From 389ff82dd0aeec30c31c5e11cc4f7658a884872e Mon Sep 17 00:00:00 2001 From: Bob den Otter Date: Thu, 8 Jan 2015 15:43:13 +0100 Subject: [PATCH] Added 'function_exists' for old GD versions. --- src/ThumbnailCreator.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ThumbnailCreator.php b/src/ThumbnailCreator.php index 3070d6f..29cb452 100644 --- a/src/ThumbnailCreator.php +++ b/src/ThumbnailCreator.php @@ -175,7 +175,11 @@ protected function doResize($src, $width, $height, $crop = false, $fit = false, case 'jpg': $img = imagecreatefromjpeg($src); // Handle exif orientation - $exif = $this->exifOrientation ? exif_read_data($src) : false; + if ($this->exifOrientation && function_exists('exif_read_data')) { + $exif = exif_read_data($src); + } else { + $exif = false; + } $modes = array(2 => 'H-', 3 => '-T', 4 => 'V-', 5 => 'VL', 6 => '-L', 7 => 'HL', 8 => '-R'); $orientation = isset($exif['Orientation']) ? $exif['Orientation'] : 0; if (isset($modes[$orientation])) {