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();
/*
$dims = getimagesize($input_file);
if (max($dims[0], $dims[1]) < min($options["width"], $options["height"])) {
// Image would get upscaled; do nothing
copy($input_file, $output_file);
} else {
$image = Image::factory($input_file)
->resize($options["width"], $options["height"], $options["master"])
->quality(module::get_var("gallery", "image_quality"));
if (graphics::can("sharpen")) {
$image->sharpen(module::get_var("gallery", "image_sharpen"));
// If this album has custom data, build the thumbnail at the specified size
if ($albumCustom->loaded()) {
$thumb_size = $albumCustom->thumb_size;
$dims = getimagesize($input_file);
if (max($dims[0], $dims[1]) < $thumb_size) {
// Image would get upscaled; do nothing
copy($input_file, $output_file);
} else {
$image = Image::factory($input_file)
->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);
}
}

View File

@ -24,10 +24,6 @@ class custom_albums_installer {
"gallery", "thumb", "custom_albums::resize",
array("width" => 0, "height" => 0, "master" => Image::AUTO),
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.
$db = Database::instance();