Code Duplication    Length = 6-7 lines in 2 locations

system/Inji/Tools.php 2 locations

@@ 134-140 (lines=7) @@
131
                $img_width = $img_height;
132
                $new_width = $max_width;
133
                $new_height = $max_height;
134
            } else {
135
                $imgX = 0;
136
                $imgY = floor(($img_height - $img_width) / 2);
137
                $img_height = $img_width;
138
                $new_width = $max_width;
139
                $new_height = $max_height;
140
            }
141
            if ($pos == 'top') {
142
                $imgY = 0;
143
            }
@@ 163-168 (lines=6) @@
160
            } else {
161
                $imgY = 0;
162
            }
163
        } else {
164
            $imgX = 0;
165
            $imgY = 0;
166
            $new_width = floor($img_width / $separator);
167
            $new_height = floor($img_height / $separator);
168
        }
169
170
        $new_res = imagecreatetruecolor($new_width, $new_height);
171
        imageAlphaBlending($new_res, false);