diff options
author | Georg Ehrke <developer@georgehrke.com> | 2013-08-15 13:20:31 +0200 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2013-08-15 13:22:04 +0200 |
commit | 7fe9320ffe60d9f8346f424a235bbc51c99f9484 (patch) | |
tree | 86abef4b8f8a9911a8d0e0084f9acb4eb1f57c45 /lib/preview | |
parent | 2fd5178a0049abc474da551dbdb2ac71fc49dec1 (diff) | |
download | nextcloud-server-7fe9320ffe60d9f8346f424a235bbc51c99f9484.tar.gz nextcloud-server-7fe9320ffe60d9f8346f424a235bbc51c99f9484.zip |
improve unknown backend
Diffstat (limited to 'lib/preview')
-rw-r--r-- | lib/preview/unknown.php | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/lib/preview/unknown.php b/lib/preview/unknown.php index ba13ca35d66..9e6cd68d401 100644 --- a/lib/preview/unknown.php +++ b/lib/preview/unknown.php @@ -16,27 +16,11 @@ class Unknown extends Provider { public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) { $mimetype = $fileview->getMimeType($path); - if(substr_count($mimetype, '/')) { - list($type, $subtype) = explode('/', $mimetype); - } - $iconsRoot = \OC::$SERVERROOT . '/core/img/filetypes/'; + $path = \OC_Helper::mimetypeIcon($mimetype); + $path = \OC::$SERVERROOT . substr($path, strlen(\OC::$WEBROOT)); - if(isset($type)){ - $icons = array($mimetype, $type, 'text'); - }else{ - $icons = array($mimetype, 'text'); - } - foreach($icons as $icon) { - $icon = str_replace('/', '-', $icon); - - $iconPath = $iconsRoot . $icon . '.png'; - - if(file_exists($iconPath)) { - return new \OC_Image($iconPath); - } - } - return false; + return new \OC_Image($path); } } |