From 29fb315ffcbfb910a36b58ca99cdefb1fe531423 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 21 Sep 2017 11:32:22 +0200 Subject: Allow requesting the max preview Signed-off-by: Roeland Jago Douma --- lib/private/Preview/Generator.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') 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); -- cgit v1.2.3