diff options
author | Olivier Paroz <github@oparoz.com> | 2015-04-14 18:01:56 +0200 |
---|---|---|
committer | Olivier Paroz <github@oparoz.com> | 2015-06-18 11:35:08 +0200 |
commit | 13617a04751b980fbb8b601829d8ff32e55274c3 (patch) | |
tree | 53bafbe99ea60bd3080f5f19f2011b14f97f0581 /lib | |
parent | 446f628136532fe556757c3fe39655c6304e3cb9 (diff) | |
download | nextcloud-server-13617a04751b980fbb8b601829d8ff32e55274c3.tar.gz nextcloud-server-13617a04751b980fbb8b601829d8ff32e55274c3.zip |
Send the mime icon if we can't generate a preview
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/preview.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/preview.php b/lib/private/preview.php index 145b7924c05..d8a9a3e1b78 100644 --- a/lib/private/preview.php +++ b/lib/private/preview.php @@ -701,9 +701,12 @@ class Preview { $this->generatePreview($fileId); } - // We still don't have a preview, so we generate an empty object which can't be displayed + // We still don't have a preview, so we send back the mime icon if (is_null($this->preview)) { $this->preview = new \OC_Image(); + $mimeIconWebPath = \OC_Helper::mimetypeIcon($this->mimeType); + $mimeIconServerPath = str_replace(\OC::$WEBROOT, \OC::$SERVERROOT, $mimeIconWebPath); + $this->preview->loadFromFile($mimeIconServerPath); } return $this->preview; |