]> source.dussan.org Git - nextcloud-server.git/commitdiff
check if svg of filetype icon exists
authorGeorg Ehrke <developer@georgehrke.com>
Wed, 25 Sep 2013 08:39:15 +0000 (10:39 +0200)
committerMorris Jobke <morris.jobke@gmail.com>
Mon, 7 Oct 2013 11:19:21 +0000 (13:19 +0200)
lib/private/preview/unknown.php

index 59667a7752323034e9533b8c13b1de0190cc20c8..722bb727f57150fb6f96e07469ac729855e0494c 100644 (file)
@@ -20,9 +20,9 @@ class Unknown extends Provider {
                $path = \OC_Helper::mimetypeIcon($mimetype);
                $path = \OC::$SERVERROOT . substr($path, strlen(\OC::$WEBROOT));
 
-               if (extension_loaded('imagick')) {
-                               $path = substr_replace($path, 'svg', -3);
+               $svgPath = substr_replace($path, 'svg', -3);
 
+               if (extension_loaded('imagick') && file_exists($svgPath)) {
                                $svg = new \Imagick();
                                $svg->setBackgroundColor(new \ImagickPixel('transparent'));
                                $svg->readImage($path);