summaryrefslogtreecommitdiffstats
path: root/lib/preview
diff options
context:
space:
mode:
Diffstat (limited to 'lib/preview')
-rw-r--r--lib/preview/images.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/preview/images.php b/lib/preview/images.php
index 52aad67ca8b..a8f203528c5 100644
--- a/lib/preview/images.php
+++ b/lib/preview/images.php
@@ -13,11 +13,20 @@ class OC_Preview_Image extends OC_Preview_Provider{
}
public function getThumbnail($path,$maxX,$maxY,$scalingup,$fileview) {
- //new image object
- $image = new \OC_Image($fileview->fopen($path, 'r'));
+ //get fileinfo
+ $fileinfo = $fileview->getFileInfo($path);
+
+ //check if file is encrypted
+ if($fileinfo['encrypted'] === true){
+ $image = new \OC_Image($fileview->fopen($path, 'r'));
+ }else{
+ $image = new \OC_Image();
+ $image->loadFromFile($fileview->getLocalFile($path));
+ }
+
//check if image object is valid
if (!$image->valid()) return false;
-
+
return $image;
}
}