Code Duplication    Length = 6-7 lines in 2 locations

system/Inji/Tools.php 2 locations

@@ 128-134 (lines=7) @@
125
                $img_width = $img_height;
126
                $new_width = $max_width;
127
                $new_height = $max_height;
128
            } else {
129
                $imgX = 0;
130
                $imgY = floor(($img_height - $img_width) / 2);
131
                $img_height = $img_width;
132
                $new_width = $max_width;
133
                $new_height = $max_height;
134
            }
135
            if ($pos == 'top') {
136
                $imgY = 0;
137
            }
@@ 157-162 (lines=6) @@
154
            } else {
155
                $imgY = 0;
156
            }
157
        } else {
158
            $imgX = 0;
159
            $imgY = 0;
160
            $new_width = floor($img_width / $separator);
161
            $new_height = floor($img_height / $separator);
162
        }
163
164
        $new_res = imagecreatetruecolor($new_width, $new_height);
165
        imageAlphaBlending($new_res, false);