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 */