Skip to content
Snippets Groups Projects
Commit f89a23b4 authored by Georg Ehrke's avatar Georg Ehrke
Browse files

implement unknown preview backend

parent 1f52ad03
Branches
No related tags found
No related merge requests found
...@@ -15,12 +15,24 @@ class Unknown extends Provider { ...@@ -15,12 +15,24 @@ class Unknown extends Provider {
} }
public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) { public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) {
/*$mimetype = $fileview->getMimeType($path); $mimetype = $fileview->getMimeType($path);
$info = $fileview->getFileInfo($path); if(substr_count($mimetype, '/')) {
$name = array_key_exists('name', $info) ? $info['name'] : ''; list($type, $subtype) = explode('/', $mimetype);
$size = array_key_exists('size', $info) ? $info['size'] : 0; }
$isencrypted = array_key_exists('encrypted', $info) ? $info['encrypted'] : false;*/ // show little lock
return new \OC_Image(); $iconsroot = \OC::$SERVERROOT . '/core/img/filetypes/';
$icons = array($mimetype, $type, 'text');
foreach($icons as $icon) {
$icon = str_replace('/', '-', $icon);
$iconpath = $iconsroot . $icon . '.png';
if(file_exists($iconpath)) {
return new \OC_Image($iconpath);
}
}
return false;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment