Allow requesting the max preview

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2017-09-21 11:32:22 +02:00
parent 1ad79e3039
commit 29fb315ffc
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 6 additions and 0 deletions

View File

@ -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);