Code Duplication    Length = 23-23 lines in 2 locations

application/modules/gallery/admin.php 2 locations

@@ 954-976 (lines=23) @@
951
                $config['height'] = $this->conf['max_height'];
952
                $config['quality'] = $this->conf['quality'];
953
954
                if (($this->conf['maintain_ratio']) AND ($this->conf['crop'])) { // Уменьшаем изображение и обрезаем края
955
                    $size = $this->get_image_size($file['full_path']); // Получаем размеры сторон изображения
956
957
                    $size['width'] >= $size['height'] ? $config['master_dim'] = 'height' : $config['master_dim'] = 'width'; // Задаем master_dim
958
959
                    $this->image_lib->clear();
960
                    $this->image_lib->initialize($config);
961
                    $this->image_lib->resize();
962
963
                    $config['image_library'] = $this->conf['engine'];
964
                    $config['source_image'] = $file['full_path'];
965
                    $config['maintain_ratio'] = FALSE;
966
                    $config['width'] = $this->conf['max_width'];
967
                    $config['height'] = $this->conf['max_height'];
968
969
                    $this->image_lib->clear();
970
                    $this->image_lib->initialize($config);
971
                    $this->image_lib->crop();
972
                } else { // Только уменьшаем
973
                    $this->image_lib->clear();
974
                    $this->image_lib->initialize($config);
975
                    $this->image_lib->resize();
976
                }
977
            }
978
        }
979
        // Create image preview
@@ 993-1015 (lines=23) @@
990
            $config['height'] = $this->conf['prev_img_height'];
991
            $config['quality'] = $this->conf['quality'];
992
993
            if (($this->conf['maintain_ratio_prev']) AND ($this->conf['crop_prev'])) { // Уменьшаем изображение и обрезаем края
994
                $size = $this->get_image_size($file['full_path']); // Получаем размеры сторон изображения
995
996
                $size['width'] >= $size['height'] ? $config['master_dim'] = 'height' : $config['master_dim'] = 'width'; // Задаем master_dim
997
998
                $this->image_lib->clear();
999
                $this->image_lib->initialize($config);
1000
                $this->image_lib->resize();
1001
1002
                $config['image_library'] = $this->conf['engine'];
1003
                $config['source_image'] = $prev_img_name;
1004
                $config['maintain_ratio'] = FALSE;
1005
                $config['width'] = $this->conf['prev_img_width'];
1006
                $config['height'] = $this->conf['prev_img_height'];
1007
1008
                $this->image_lib->clear();
1009
                $this->image_lib->initialize($config);
1010
                $this->image_lib->crop();
1011
            } else { // Только уменьшаем
1012
                $this->image_lib->clear();
1013
                $this->image_lib->initialize($config);
1014
                $this->image_lib->resize();
1015
            }
1016
        } else {
1017
            $this->load->helper('File');
1018
            $file_data = read_file($file['full_path']);