diff options
author | Georg Ehrke <georg@ownCloud.com> | 2013-05-28 10:21:02 +0200 |
---|---|---|
committer | Georg Ehrke <georg@ownCloud.com> | 2013-05-28 10:21:02 +0200 |
commit | 005d8e98706fc98d8dc5aa4927bb3ab0e6b00ac2 (patch) | |
tree | 8a0f3f2946f86f87cf67d8347a5321fa8a38d396 /lib/preview | |
parent | 62411965f9ccfbe66584e91bc325d156e08196d2 (diff) | |
download | nextcloud-server-005d8e98706fc98d8dc5aa4927bb3ab0e6b00ac2.tar.gz nextcloud-server-005d8e98706fc98d8dc5aa4927bb3ab0e6b00ac2.zip |
update images.php
Diffstat (limited to 'lib/preview')
-rw-r--r-- | lib/preview/images.php | 15 |
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; } } |