Maybe working?
This commit is contained in:
parent
9f24bc9df6
commit
1c198b4f6a
@ -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
|
||||||
|
if ($albumCustom->loaded()) {
|
||||||
|
$thumb_size = $albumCustom->thumb_size;
|
||||||
|
|
||||||
$dims = getimagesize($input_file);
|
$dims = getimagesize($input_file);
|
||||||
if (max($dims[0], $dims[1]) < min($options["width"], $options["height"])) {
|
if (max($dims[0], $dims[1]) < $thumb_size) {
|
||||||
// Image would get upscaled; do nothing
|
// Image would get upscaled; do nothing
|
||||||
copy($input_file, $output_file);
|
copy($input_file, $output_file);
|
||||||
} else {
|
} else {
|
||||||
$image = Image::factory($input_file)
|
$image = Image::factory($input_file)
|
||||||
->resize($options["width"], $options["height"], $options["master"])
|
->resize($thumb_size, $thumb_size, $options["master"])
|
||||||
->quality(module::get_var("gallery", "image_quality"));
|
->quality(module::get_var("gallery", "image_quality"));
|
||||||
if (graphics::can("sharpen")) {
|
if (graphics::can("sharpen")) {
|
||||||
$image->sharpen(module::get_var("gallery", "image_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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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();
|
||||||
|
Reference in New Issue
Block a user