summaryrefslogtreecommitdiffstats
path: root/lib/preview
diff options
context:
space:
mode:
authorGeorg Ehrke <georg@ownCloud.com>2013-05-28 10:21:02 +0200
committerGeorg Ehrke <georg@ownCloud.com>2013-05-28 10:21:02 +0200
commit005d8e98706fc98d8dc5aa4927bb3ab0e6b00ac2 (patch)
tree8a0f3f2946f86f87cf67d8347a5321fa8a38d396 /lib/preview
parent62411965f9ccfbe66584e91bc325d156e08196d2 (diff)
downloadnextcloud-server-005d8e98706fc98d8dc5aa4927bb3ab0e6b00ac2.tar.gz
nextcloud-server-005d8e98706fc98d8dc5aa4927bb3ab0e6b00ac2.zip
update images.php
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;
}
}