$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);
$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');
}