mirror of
https://github.com/nextcloud/server.git
synced 2026-04-25 16:19:06 -04:00
Send the mime icon if we can't generate a preview
This commit is contained in:
parent
446f628136
commit
13617a0475
1 changed files with 4 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue