]> source.dussan.org Git - nextcloud-server.git/commitdiff
use oc_filesystem::getlocalfile instead of manually trying to get the correct local...
authorRobin Appelman <icewind@owncloud.com>
Thu, 26 Jan 2012 17:12:59 +0000 (18:12 +0100)
committerRobin Appelman <icewind@owncloud.com>
Thu, 26 Jan 2012 17:12:59 +0000 (18:12 +0100)
fixes broken album covers on shared files

apps/gallery/ajax/cover.php
apps/gallery/lib/scanner.php

index 181a919375db977f3eb1d20604343648887e44c6..068a6e9c4ecd5b1594aff192781fcbe6110bb5f7 100644 (file)
@@ -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);
index 447174e84c0f3dd41ec587e137c941cc809f6adf..dfb9edebfea864046bfc59f933b793bea4608fd1 100644 (file)
@@ -82,7 +82,8 @@ class OC_Gallery_Scanner {
     $file_count = min(count($files), 10);
     $thumbnail = imagecreatetruecolor($file_count*200, 200);
     for ($i = 0; $i < $file_count; $i++) {
-      CroppedThumbnail(OC_Config::getValue("datadirectory").'/'. OC_User::getUser() .'/files/'.$files[$i], 200, 200, $thumbnail, $i*200);
+               $imagePath = OC_Filesystem::getLocalFile($files[$i]);
+      CroppedThumbnail($imagePath, 200, 200, $thumbnail, $i*200);
     }
     imagepng($thumbnail, OC_Config::getValue("datadirectory").'/'. OC_User::getUser() .'/gallery/' . $albumName.'.png');
   }