From 45f170bc61fdfb082e8fdf4127f7484fead10751 Mon Sep 17 00:00:00 2001 From: Nick Ryzhy Date: Sat, 28 Nov 2015 20:25:12 +0300 Subject: [PATCH] Update admin.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit нормальный crop с центровкой кантинки --- application/modules/gallery/admin.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/application/modules/gallery/admin.php b/application/modules/gallery/admin.php index 330c080faa..17c58464e6 100755 --- a/application/modules/gallery/admin.php +++ b/application/modules/gallery/admin.php @@ -954,6 +954,8 @@ private function resize_and_thumb($file = []) { $config['maintain_ratio'] = FALSE; $config['width'] = $this->conf['max_width']; $config['height'] = $this->conf['max_height']; + $config['x_axis'] = round( ( $this->image_lib->width - $this->conf['thumb_width'] ) / 2 ); + $config['y_axis'] = round( ( $this->image_lib->height - $this->conf['thumb_height'] ) / 2 ); $this->image_lib->clear(); $this->image_lib->initialize($config); @@ -993,6 +995,8 @@ private function resize_and_thumb($file = []) { $config['maintain_ratio'] = FALSE; $config['width'] = $this->conf['prev_img_width']; $config['height'] = $this->conf['prev_img_height']; + $config['x_axis'] = round( ( $this->image_lib->width - $this->conf['thumb_width'] ) / 2 ); + $config['y_axis'] = round( ( $this->image_lib->height - $this->conf['thumb_height'] ) / 2 ); $this->image_lib->clear(); $this->image_lib->initialize($config); @@ -1038,6 +1042,8 @@ private function resize_and_thumb($file = []) { $config['maintain_ratio'] = FALSE; $config['width'] = $this->conf['thumb_width']; $config['height'] = $this->conf['thumb_height']; + $config['x_axis'] = round( ( $this->image_lib->width - $this->conf['thumb_width'] ) / 2 ); + $config['y_axis'] = round( ( $this->image_lib->height - $this->conf['thumb_height'] ) / 2 ); $this->image_lib->clear(); $this->image_lib->initialize($config); @@ -1125,4 +1131,4 @@ private function make_watermark($file_path) { } -/* End of file admin.php */ \ No newline at end of file +/* End of file admin.php */