Code Duplication    Length = 6-7 lines in 2 locations

system/Inji/Tools.php 2 locations

@@ 124-130 (lines=7) @@
121
                $img_width = $img_height;
122
                $new_width = $max_width;
123
                $new_height = $max_height;
124
            } else {
125
                $imgX = 0;
126
                $imgY = floor(($img_height - $img_width) / 2);
127
                $img_height = $img_width;
128
                $new_width = $max_width;
129
                $new_height = $max_height;
130
            }
131
            if ($pos == 'top') {
132
                $imgY = 0;
133
            }
@@ 153-158 (lines=6) @@
150
            } else {
151
                $imgY = 0;
152
            }
153
        } else {
154
            $imgX = 0;
155
            $imgY = 0;
156
            $new_width = floor($img_width / $separator);
157
            $new_height = floor($img_height / $separator);
158
        }
159
160
        $new_res = imagecreatetruecolor($new_width, $new_height);
161
        imageAlphaBlending($new_res, false);