function handleGetThumbnails($albumname) {
OCP\Response::enableCaching(3600 * 24); // 24 hour
- $view = OCP\App::getStorage('gallery');
+ $view = OCP\Files::getStorage('gallery');
$thumbnail = $view->fopen(urldecode($albumname).'.png', 'r');
header('Content-Type: '.OC_Image::getMimeTypeForFile($thumbnail));
OCP\Response::sendFile($thumbnail);
function handleGetAlbumThumbnail($token, $albumname)
{
$owner = OC_Gallery_Sharing::getTokenOwner($token);
- $view = OCP\App::getStorage('gallery');
+ $view = OCP\Files::getStorage('gallery');
$file = $view->fopen($albumname.'.png', 'r');
$image = new OC_Image($file);
if ($image->valid()) {
function handleGetPhoto($token, $photo) {
$owner = OC_Gallery_Sharing::getTokenOwner($token);
- $view = OCP\App::getStorage('files');
+ $view = OCP\Files::getStorage('files');
$file = $view->fopen(urldecode($photo), 'r');
header('Content-Type: '.OC_Image::getMimeTypeForFile($file));
OCP\Response::sendFile($file);
}
public static function changeThumbnailPath($oldname, $newname) {
- $view = OCP\App::getStorage('gallery');
+ $view = OCP\Files::getStorage('gallery');
$view->rename($oldname.'.png', $newname.'.png');
}
public static function getThumbnail($image_name, $owner = null) {
if (!$owner) $owner = OCP\USER::getUser();
- $view = OCP\App::getStorage('gallery');
+ $view = OCP\Files::getStorage('gallery');
$save_dir = dirname($image_name);
if (!$view->is_dir($save_dir)) {
$view->mkdir($save_dir);
$image->destroy();
}
}
- $view = OCP\App::getStorage('gallery');
+ $view = OCP\Files::getStorage('gallery');
imagepng($thumbnail, $view->getLocalFile($albumName.'.png'));
imagedestroy($thumbnail);
}