check if svg of filetype icon exists

This commit is contained in:
Georg Ehrke 2013-09-25 10:39:15 +02:00 committed by Morris Jobke
parent f81053072f
commit 8a35d79a39
1 changed files with 2 additions and 2 deletions

View 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);