aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/Wallabag/CoreBundle/Helper/DownloadImages.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/Wallabag/CoreBundle/Helper/DownloadImages.php b/src/Wallabag/CoreBundle/Helper/DownloadImages.php
index bc2afc64..9a7e9828 100644
--- a/src/Wallabag/CoreBundle/Helper/DownloadImages.php
+++ b/src/Wallabag/CoreBundle/Helper/DownloadImages.php
@@ -137,10 +137,15 @@ class DownloadImages
137 case 'gif': 137 case 'gif':
138 // use Imagick if available to keep GIF animation 138 // use Imagick if available to keep GIF animation
139 if (class_exists('\\Imagick')) { 139 if (class_exists('\\Imagick')) {
140 $imagick = new \Imagick(); 140 try {
141 $imagick->readImageBlob($res->getBody()); 141 $imagick = new \Imagick();
142 $imagick->setImageFormat('gif'); 142 $imagick->readImageBlob($res->getBody());
143 $imagick->writeImages($localPath, true); 143 $imagick->setImageFormat('gif');
144 $imagick->writeImages($localPath, true);
145 } catch (\Exception $e) {
146 // if Imagick fail, fallback to the default solution
147 imagegif($im, $localPath);
148 }
144 } else { 149 } else {
145 imagegif($im, $localPath); 150 imagegif($im, $localPath);
146 } 151 }