Code Duplication    Length = 6-7 lines in 2 locations

system/Inji/Tools.php 2 locations

@@ 116-122 (lines=7) @@
113
                $img_width = $img_height;
114
                $new_width = $max_width;
115
                $new_height = $max_height;
116
            } else {
117
                $imgX = 0;
118
                $imgY = floor(( $img_height - $img_width ) / 2);
119
                $img_height = $img_width;
120
                $new_width = $max_width;
121
                $new_height = $max_height;
122
            }
123
            if ($pos == 'top') {
124
                $imgY = 0;
125
            }
@@ 145-150 (lines=6) @@
142
            } else {
143
                $imgY = 0;
144
            }
145
        } else {
146
            $imgX = 0;
147
            $imgY = 0;
148
            $new_width = floor($img_width / $separator);
149
            $new_height = floor($img_height / $separator);
150
        }
151
152
        $new_res = imagecreatetruecolor($new_width, $new_height);
153
        imageAlphaBlending($new_res, false);