diff --git a/3.0/modules/rectangle_thumbs/helpers/rectangle_thumbs_graphics.php b/3.0/modules/rectangle_thumbs/helpers/rectangle_thumbs_graphics.php new file mode 100644 index 00000000..9334972c --- /dev/null +++ b/3.0/modules/rectangle_thumbs/helpers/rectangle_thumbs_graphics.php @@ -0,0 +1,72 @@ + $dims[0]) { + // Too wide, scale it down + list ($new_width, $new_height) = array($dims[0], $dims[0] / $desired_ratio); + } + + if ($new_height > $dims[1]) { + // Too tall, scale it down some more + $new_width = min($dims[0], $dims[1] * $desired_ratio); + $new_height = $new_width / $desired_ratio; + } + $new_width = round($new_width); + $new_height = round($new_height); + + Image::factory($input_file) + ->crop($new_width, $new_height) + ->quality(module::get_var("gallery", "image_quality")) + ->save($output_file); + } +} diff --git a/3.0/modules/rectangle_thumbs/helpers/rectangle_thumbs_installer.php b/3.0/modules/rectangle_thumbs/helpers/rectangle_thumbs_installer.php new file mode 100644 index 00000000..1fc6815c --- /dev/null +++ b/3.0/modules/rectangle_thumbs/helpers/rectangle_thumbs_installer.php @@ -0,0 +1,29 @@ +