summaryrefslogtreecommitdiff
path: root/core/helpers/photo.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2008-12-13 05:01:12 +0000
committerTim Almdal <tnalmdal@shaw.ca>2008-12-13 05:01:12 +0000
commit80792d4fb156e8c9a06760361bbb66b5a7c1db59 (patch)
tree4caaa4dddc62828ed8adc67282e4133bb5c42fae /core/helpers/photo.php
parent7b7bf37e673d184556c114d6083b2d7699ab00d3 (diff)
Set the resize and thumbnail maximum dimension into the module vars table
Diffstat (limited to 'core/helpers/photo.php')
-rw-r--r--core/helpers/photo.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/helpers/photo.php b/core/helpers/photo.php
index 8f204714..2edd8a4f 100644
--- a/core/helpers/photo.php
+++ b/core/helpers/photo.php
@@ -77,10 +77,12 @@ class photo_Core {
$photo->add_to_parent($parent);
copy($filename, $photo->file_path());
- // @todo: parameterize these dimensions
// This saves the photo a second time, which is unfortunate but difficult to avoid.
- $result = $photo->set_thumbnail($filename, 200, 200)
- ->set_resize($filename, 640, 640)
+ $thumbnail_size = module::get_var("core", "thumbnail_size");
+ $resize_size = module::get_var("core", "resize_size");
+
+ $result = $photo->set_thumbnail($filename, $thumbnail_size, $thumbnail_size)
+ ->set_resize($filename, $resize_size, $resize_size)
->save();
module::event("photo_created", $photo);