getFileInfo($path); //check if file is encrypted if($fileinfo['encrypted'] === true) { $image = new \OC_Image(stream_get_contents($fileview->fopen($path, 'r'))); }else{ $image = new \OC_Image(); $image->loadFromFile($fileview->getLocalFile($path)); } return $image->valid() ? $image : false; } } \OC\PreviewManager::registerProvider('OC\Preview\Image');