memory cleanup in gallery

This commit is contained in:
Robin Appelman 2012-03-26 22:40:38 +02:00
parent 0ba9332358
commit 3f881f1ca5
2 changed files with 4 additions and 3 deletions

View File

@ -66,9 +66,9 @@ class OC_Gallery_Photo {
$stmt->execute(array($newpath, $newAlbumId, $oldAlbumId, $oldpath)); $stmt->execute(array($newpath, $newAlbumId, $oldAlbumId, $oldpath));
} }
public static function getThumbnail($image_name, $owner = null) { public static function getThumbnail($image_name, $owner = null) {
if (!$owner) $owner = OC_User::getUser(); if (!$owner) $owner = OC_User::getUser();
$save_dir = OC_Config::getValue("datadirectory").'/'. $owner .'/gallery/'; $save_dir = OC_Config::getValue("datadirectory").'/'. $owner .'/gallery/';
$save_dir .= dirname($image_name). '/'; $save_dir .= dirname($image_name). '/';
$image_path = $image_name; $image_path = $image_name;
$thumb_file = $save_dir . basename($image_name); $thumb_file = $save_dir . basename($image_name);

View File

@ -81,6 +81,7 @@ class OC_Gallery_Scanner {
} }
} }
imagepng($thumbnail, OC_Config::getValue("datadirectory").'/'. OC_User::getUser() .'/gallery/' . $albumName.'.png'); imagepng($thumbnail, OC_Config::getValue("datadirectory").'/'. OC_User::getUser() .'/gallery/' . $albumName.'.png');
imagedestroy($thumbnail);
} }
public static function createIntermediateAlbums() { public static function createIntermediateAlbums() {