summaryrefslogtreecommitdiffstats
path: root/apps/gallery/lib/photo.php
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-02-13 22:39:30 +0100
committerBart Visscher <bartv@thisnet.nl>2012-02-13 22:39:30 +0100
commit169ddc5b0b14697088ca394eb07fa7c8473b1fcc (patch)
treea1ea39a132946600a2267cce10cc14fa1407df70 /apps/gallery/lib/photo.php
parente137020f67f97bb04e59c04205e1815229d95fae (diff)
downloadnextcloud-server-169ddc5b0b14697088ca394eb07fa7c8473b1fcc.tar.gz
nextcloud-server-169ddc5b0b14697088ca394eb07fa7c8473b1fcc.zip
Gallery: Only get local file when generating photo thumbnail
Diffstat (limited to 'apps/gallery/lib/photo.php')
-rw-r--r--apps/gallery/lib/photo.php9
1 files changed, 4 insertions, 5 deletions
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;