aboutsummaryrefslogtreecommitdiffstats
path: root/apps/gallery/ajax
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-01-26 18:12:59 +0100
committerRobin Appelman <icewind@owncloud.com>2012-01-26 18:12:59 +0100
commit266fbb442ebefbec92d159204833848edf314fcf (patch)
treeaae7dec9b39484c311c6be180ba22d7511b3885f /apps/gallery/ajax
parent935b828427454cc2e175bf0bb3e3cf168a3257c2 (diff)
downloadnextcloud-server-266fbb442ebefbec92d159204833848edf314fcf.tar.gz
nextcloud-server-266fbb442ebefbec92d159204833848edf314fcf.zip
use oc_filesystem::getlocalfile instead of manually trying to get the correct local file when creating album covers
fixes broken album covers on shared files
Diffstat (limited to 'apps/gallery/ajax')
-rw-r--r--apps/gallery/ajax/cover.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/gallery/ajax/cover.php b/apps/gallery/ajax/cover.php
index 181a919375d..068a6e9c4ec 100644
--- a/apps/gallery/ajax/cover.php
+++ b/apps/gallery/ajax/cover.php
@@ -70,11 +70,11 @@ $x = min((int)($x/($box_size/$result->numRows())), $result->numRows()-1); // get
$result->seek($x); // never throws
$path = $result->fetchRow();
$path = $path['file_path'];
-$tmp = OC::$CONFIG_DATADIRECTORY . $path;
-$imagesize = getimagesize($tmp);
+$imagePath = OC_Filesystem::getLocalFile($img);
+$imagesize = getimagesize($imagePath);
header('Content-Type: image/png');
-$image = CroppedThumbnail($tmp, $box_size, $box_size);
+$image = CroppedThumbnail($imagePath, $box_size, $box_size);
imagepng($image);
imagedestroy($image);