setResolution($maxX, $maxY); $content = stream_get_contents($fileview->fopen($path, 'r')); if(substr($content, 0, 5) !== '' . $content; } $svg->readImageBlob($content); $svg->setImageFormat('jpg'); } catch (\Exception $e) { \OC_Log::write('core', $e->getmessage(), \OC_Log::ERROR); return false; } //new image object $image = new \OC_Image($svg); //check if image object is valid return $image->valid() ? $image : false; } } \OC\Preview::registerProvider('OC\Preview\SVG'); }