From 180252cc6464e7b5e0a6d2aac93322b7237692a7 Mon Sep 17 00:00:00 2001 From: rr- Date: Sun, 6 Sep 2015 22:57:53 +0200 Subject: [PATCH] Removed masking of image extensions' exceptions --- .../ImageManipulation/GdImageManipulator.php | 9 +-------- .../ImagickImageManipulator.php | 17 +++++------------ 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/src/Services/ImageManipulation/GdImageManipulator.php b/src/Services/ImageManipulation/GdImageManipulator.php index eea75bfb..69782dd2 100644 --- a/src/Services/ImageManipulation/GdImageManipulator.php +++ b/src/Services/ImageManipulation/GdImageManipulator.php @@ -5,14 +5,7 @@ class GdImageManipulator implements IImageManipulator { public function loadFromBuffer($source) { - try - { - return imagecreatefromstring($source); - } - catch (\Exception $e) - { - return null; - } + return imagecreatefromstring($source); } public function getImageWidth($imageResource) diff --git a/src/Services/ImageManipulation/ImagickImageManipulator.php b/src/Services/ImageManipulation/ImagickImageManipulator.php index 9779a436..ada1b540 100644 --- a/src/Services/ImageManipulation/ImagickImageManipulator.php +++ b/src/Services/ImageManipulation/ImagickImageManipulator.php @@ -5,18 +5,11 @@ class ImagickImageManipulator implements IImageManipulator { public function loadFromBuffer($source) { - try - { - $image = new \Imagick(); - $image->readImageBlob($source); - if ($image->getImageFormat() == 'GIF') - $image = $image->coalesceImages(); - return $image; - } - catch (\Exception $e) - { - return null; - } + $image = new \Imagick(); + $image->readImageBlob($source); + if ($image->getImageFormat() == 'GIF') + $image = $image->coalesceImages(); + return $image; } public function getImageWidth($imageResource)