summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/controllers/welcome.php3
-rw-r--r--core/helpers/album.php13
2 files changed, 2 insertions, 14 deletions
diff --git a/core/controllers/welcome.php b/core/controllers/welcome.php
index 7509dc89..0106535a 100644
--- a/core/controllers/welcome.php
+++ b/core/controllers/welcome.php
@@ -96,7 +96,8 @@ class Welcome_Controller extends Template_Controller {
switch(rand(0, 1)) {
case 0:
$parents[] = album::create($parent->id, "rnd_" . rand(), "Rnd $i", "rnd $i")
- ->set_thumbnail(DOCROOT . "core/tests/test.jpg", 200, 150);
+ ->set_thumbnail(DOCROOT . "core/tests/test.jpg", 200, 150)
+ ->save();
break;
case 1:
diff --git a/core/helpers/album.php b/core/helpers/album.php
index 6934932e..021c09f3 100644
--- a/core/helpers/album.php
+++ b/core/helpers/album.php
@@ -54,17 +54,4 @@ class Album_Core {
}
return $album;
}
-
- static function set_thumbnail($id, $filename) {
- $album = ORM::factory("item", $id);
-
- /** @todo: parameterize these dimensions */
- $image = Image::factory($filename);
- $image->resize(200, 140, Image::WIDTH)->save($album->thumbnail_path());
-
- $dims = getimagesize($album->thumbnail_path());
- $album->thumbnail_width = $dims[0];
- $album->thumbnail_height = $dims[1];
- return $album->save();
- }
}