check if svg of filetype icon exists
This commit is contained in:
parent
f81053072f
commit
8a35d79a39
|
@ -20,9 +20,9 @@ class Unknown extends Provider {
|
||||||
$path = \OC_Helper::mimetypeIcon($mimetype);
|
$path = \OC_Helper::mimetypeIcon($mimetype);
|
||||||
$path = \OC::$SERVERROOT . substr($path, strlen(\OC::$WEBROOT));
|
$path = \OC::$SERVERROOT . substr($path, strlen(\OC::$WEBROOT));
|
||||||
|
|
||||||
if (extension_loaded('imagick')) {
|
$svgPath = substr_replace($path, 'svg', -3);
|
||||||
$path = substr_replace($path, 'svg', -3);
|
|
||||||
|
|
||||||
|
if (extension_loaded('imagick') && file_exists($svgPath)) {
|
||||||
$svg = new \Imagick();
|
$svg = new \Imagick();
|
||||||
$svg->setBackgroundColor(new \ImagickPixel('transparent'));
|
$svg->setBackgroundColor(new \ImagickPixel('transparent'));
|
||||||
$svg->readImage($path);
|
$svg->readImage($path);
|
||||||
|
|
Loading…
Reference in New Issue