1
0

Maybe working?

This commit is contained in:
colings 2011-01-02 23:47:30 +08:00 committed by Bharat Mediratta
parent 9f24bc9df6
commit 1c198b4f6a
2 changed files with 17 additions and 17 deletions

View File

@ -37,21 +37,25 @@ class custom_albums_graphics_Core {
$albumCustom = ORM::factory("custom_album")->where("album_id", "=", $options["parent_id"])->find(); $albumCustom = ORM::factory("custom_album")->where("album_id", "=", $options["parent_id"])->find();
/* // If this album has custom data, build the thumbnail at the specified size
$dims = getimagesize($input_file); if ($albumCustom->loaded()) {
if (max($dims[0], $dims[1]) < min($options["width"], $options["height"])) { $thumb_size = $albumCustom->thumb_size;
// Image would get upscaled; do nothing
copy($input_file, $output_file); $dims = getimagesize($input_file);
} else { if (max($dims[0], $dims[1]) < $thumb_size) {
$image = Image::factory($input_file) // Image would get upscaled; do nothing
->resize($options["width"], $options["height"], $options["master"]) copy($input_file, $output_file);
->quality(module::get_var("gallery", "image_quality")); } else {
if (graphics::can("sharpen")) { $image = Image::factory($input_file)
$image->sharpen(module::get_var("gallery", "image_sharpen")); ->resize($thumb_size, $thumb_size, $options["master"])
->quality(module::get_var("gallery", "image_quality"));
if (graphics::can("sharpen")) {
$image->sharpen(module::get_var("gallery", "image_sharpen"));
}
$image->save($output_file);
} }
$image->save($output_file);
} }
*/
module::event("graphics_resize_completed", $input_file, $output_file, $options); module::event("graphics_resize_completed", $input_file, $output_file, $options);
} }
} }

View File

@ -24,10 +24,6 @@ class custom_albums_installer {
"gallery", "thumb", "custom_albums::resize", "gallery", "thumb", "custom_albums::resize",
array("width" => 0, "height" => 0, "master" => Image::AUTO), array("width" => 0, "height" => 0, "master" => Image::AUTO),
200); 200);
graphics::add_rule(
"gallery", "resize", "custom_albums::resize",
array("width" => 0, "height" => 0, "master" => Image::AUTO),
200);
// Create a table to store custom album info in. // Create a table to store custom album info in.
$db = Database::instance(); $db = Database::instance();