Skip to content

Commit

Permalink
Check if a preview provider is available before using it
Browse files Browse the repository at this point in the history
Else if a preview provider is registerd but not available (for example
missing support in some external lib). It will do 💥. This way the
providers can at least do the sanity checks required.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
  • Loading branch information
rullzer committed Aug 16, 2018
1 parent 8c1a0a5 commit ec06b87
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/private/Preview/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ private function getMaxPreview(ISimpleFolder $previewFolder, File $file, $mimeTy
continue;
}

if (!$provider->isAvailable($file)) {
continue;
}

$maxWidth = (int)$this->config->getSystemValue('preview_max_x', 4096);
$maxHeight = (int)$this->config->getSystemValue('preview_max_y', 4096);

Expand Down

0 comments on commit ec06b87

Please sign in to comment.