summaryrefslogtreecommitdiffstats
path: root/lib/private/Preview
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-09-21 11:32:22 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2017-09-25 16:18:48 +0200
commit29fb315ffcbfb910a36b58ca99cdefb1fe531423 (patch)
treeb62f72cb4d48c7347fe5889ec2e1e45bed62ed4b /lib/private/Preview
parent1ad79e3039939285f6736a09f123fc95908ae201 (diff)
downloadnextcloud-server-29fb315ffcbfb910a36b58ca99cdefb1fe531423.tar.gz
nextcloud-server-29fb315ffcbfb910a36b58ca99cdefb1fe531423.zip
Allow requesting the max preview
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Preview')
-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);