Allow requesting the max preview
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
1ad79e3039
commit
29fb315ffc
|
@ -110,6 +110,12 @@ class Generator {
|
||||||
$maxPreview = $this->getMaxPreview($previewFolder, $file, $mimeType);
|
$maxPreview = $this->getMaxPreview($previewFolder, $file, $mimeType);
|
||||||
list($maxWidth, $maxHeight) = $this->getPreviewSize($maxPreview);
|
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
|
// Calculate the preview size
|
||||||
list($width, $height) = $this->calculateSize($width, $height, $crop, $mode, $maxWidth, $maxHeight);
|
list($width, $height) = $this->calculateSize($width, $height, $crop, $mode, $maxWidth, $maxHeight);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue