From: Georg Ehrke Date: Tue, 28 May 2013 08:21:02 +0000 (+0200) Subject: update images.php X-Git-Tag: v6.0.0alpha2~235^2~143 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=005d8e98706fc98d8dc5aa4927bb3ab0e6b00ac2;p=nextcloud-server.git update images.php --- 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; } }