summaryrefslogtreecommitdiffstats
path: root/lib/private/preview/image.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/preview/image.php')
-rw-r--r--lib/private/preview/image.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/private/preview/image.php b/lib/private/preview/image.php
index 2c69d29f4cb..dbaf5deb08d 100644
--- a/lib/private/preview/image.php
+++ b/lib/private/preview/image.php
@@ -33,7 +33,7 @@ abstract class Image extends Provider {
public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) {
//get fileinfo
$fileInfo = $fileview->getFileInfo($path);
- if(!$fileInfo) {
+ if (!$fileInfo) {
return false;
}
@@ -46,15 +46,19 @@ abstract class Image extends Provider {
$image = new \OC_Image();
- if($fileInfo['encrypted'] === true) {
+ if ($fileInfo['encrypted'] === true) {
$fileName = $fileview->toTmpFile($path);
} else {
$fileName = $fileview->getLocalFile($path);
}
$image->loadFromFile($fileName);
$image->fixOrientation();
+ if ($image->valid()) {
+ $image->scaleDownToFit($maxX, $maxY);
- return $image->valid() ? $image : false;
+ return $image;
+ }
+ return false;
}
}