summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-09-27 23:27:54 +0200
committerGitHub <noreply@github.com>2017-09-27 23:27:54 +0200
commit5f25dd7095fadccb7458dbe09c048fbf6645552d (patch)
tree914341bb1e74a13e0ebaa113192982e4bbe162d9 /lib/private
parent72889e57ca64f058f7cf206ac95cf6c0907ed771 (diff)
parent4077f684e137774f48cb1f575bc8a7bfd862c78b (diff)
downloadnextcloud-server-5f25dd7095fadccb7458dbe09c048fbf6645552d.tar.gz
nextcloud-server-5f25dd7095fadccb7458dbe09c048fbf6645552d.zip
Merge pull request #6599 from nextcloud/fix_2523
Add direct preview link
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Preview/Generator.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/private/Preview/Generator.php b/lib/private/Preview/Generator.php
index 5a264c2bbd5..71e9fdb1a20 100644
--- a/lib/private/Preview/Generator.php
+++ b/lib/private/Preview/Generator.php
@@ -110,6 +110,12 @@ class Generator {
$maxPreview = $this->getMaxPreview($previewFolder, $file, $mimeType);
list($maxWidth, $maxHeight) = $this->getPreviewSize($maxPreview);
+ // If both width and heigth are -1 we just want the max preview
+ if ($width === -1 && $height === -1) {
+ $width = $maxWidth;
+ $height = $maxHeight;
+ }
+
// Calculate the preview size
list($width, $height) = $this->calculateSize($width, $height, $crop, $mode, $maxWidth, $maxHeight);