From: Bart Visscher Date: Mon, 13 Feb 2012 21:39:30 +0000 (+0100) Subject: Gallery: Only get local file when generating photo thumbnail X-Git-Tag: v4.0.0beta~71^2~5^2~4^2~2^2~16 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=169ddc5b0b14697088ca394eb07fa7c8473b1fcc;p=nextcloud-server.git Gallery: Only get local file when generating photo thumbnail --- diff --git a/apps/gallery/lib/photo.php b/apps/gallery/lib/photo.php index 15783cb341a..4eb313bfc33 100644 --- a/apps/gallery/lib/photo.php +++ b/apps/gallery/lib/photo.php @@ -67,10 +67,6 @@ class OC_Gallery_Photo { } public static function getThumbnail($image_name) { - $imagePath = OC_Filesystem::getLocalFile($image_name); - if(!file_exists($imagePath)) { - return null; - } $save_dir = OC_Config::getValue("datadirectory").'/'. OC_User::getUser() .'/gallery/'; $save_dir .= dirname($image_name). '/'; $image_name = basename($image_name); @@ -78,6 +74,10 @@ class OC_Gallery_Photo { if (file_exists($thumb_file)) { $image = new OC_Image($thumb_file); } else { + $imagePath = OC_Filesystem::getLocalFile($image_name); + if(!file_exists($imagePath)) { + return null; + } $image = new OC_Image($imagePath); if ($image->valid()) { $image->centerCrop(); @@ -90,7 +90,6 @@ class OC_Gallery_Photo { } } if ($image->valid()) { - //var_dump($image, $image->resource()); return $image; } return null;