summaryrefslogtreecommitdiffstats
path: root/lib/private/preview/unknown.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/preview/unknown.php')
-rw-r--r--lib/private/preview/unknown.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/private/preview/unknown.php b/lib/private/preview/unknown.php
new file mode 100644
index 00000000000..9e6cd68d401
--- /dev/null
+++ b/lib/private/preview/unknown.php
@@ -0,0 +1,27 @@
+<?php
+/**
+ * Copyright (c) 2013 Frank Karlitschek frank@owncloud.org
+ * Copyright (c) 2013 Georg Ehrke georg@ownCloud.com
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+namespace OC\Preview;
+
+class Unknown extends Provider {
+
+ public function getMimeType() {
+ return '/.*/';
+ }
+
+ public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) {
+ $mimetype = $fileview->getMimeType($path);
+
+ $path = \OC_Helper::mimetypeIcon($mimetype);
+ $path = \OC::$SERVERROOT . substr($path, strlen(\OC::$WEBROOT));
+
+ return new \OC_Image($path);
+ }
+}
+
+\OC\Preview::registerProvider('OC\Preview\Unknown'); \ No newline at end of file