fixed wrong function call
This commit is contained in:
parent
fce614b82c
commit
6abe8f9e2e
|
@ -42,7 +42,7 @@ function handleRemove($name) {
|
|||
|
||||
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);
|
||||
|
|
|
@ -80,7 +80,7 @@ function handleGetThumbnail($token, $imgpath) {
|
|||
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()) {
|
||||
|
@ -94,7 +94,7 @@ function handleGetAlbumThumbnail($token, $albumname)
|
|||
|
||||
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);
|
||||
|
|
|
@ -90,7 +90,7 @@ class OC_Gallery_Album {
|
|||
}
|
||||
|
||||
public static function changeThumbnailPath($oldname, $newname) {
|
||||
$view = OCP\App::getStorage('gallery');
|
||||
$view = OCP\Files::getStorage('gallery');
|
||||
$view->rename($oldname.'.png', $newname.'.png');
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ class OC_Gallery_Photo {
|
|||
|
||||
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);
|
||||
|
|
|
@ -81,7 +81,7 @@ class OC_Gallery_Scanner {
|
|||
$image->destroy();
|
||||
}
|
||||
}
|
||||
$view = OCP\App::getStorage('gallery');
|
||||
$view = OCP\Files::getStorage('gallery');
|
||||
imagepng($thumbnail, $view->getLocalFile($albumName.'.png'));
|
||||
imagedestroy($thumbnail);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue