Code Duplication    Length = 18-18 lines in 2 locations

i.php 1 location

@@ 29-46 (lines=18) @@
26
fclose($handler);
27
exit;
28
29
switch ($FileType) {
30
    case "jpg":
31
        $img = imagecreatefromjpeg($full);
32
        break;
33
    case "png":
34
        $img = imagecreatefrompng($full);
35
        break;
36
    case "gif":
37
        $img = imagecreatefromgif($full);
38
        break;
39
    case "bmp":
40
        $img = imagecreatefromwbmp($full);
41
        break;
42
    default:
43
        throw new Exception("ERROR:image type error " . $full);
44
        exit(0);
45
        break;
46
}
47
48
$width  = imageSX($img);
49
$height = imageSY($img);

img.php 1 location

@@ 20-37 (lines=18) @@
17
$target_width  = isset($_GET['w']) ? (int)($_GET['w']) : 100;
18
$target_height = isset($_GET['h']) ? (int)($_GET['h']) : 100;
19
20
switch ($FileType) {
21
    case "jpg":
22
        $img = imagecreatefromjpeg($hotel_icon);
23
        break;
24
    case "png":
25
        $img = imagecreatefrompng($hotel_icon);
26
        break;
27
    case "gif":
28
        $img = imagecreatefromgif($hotel_icon);
29
        break;
30
    case "bmp":
31
        $img = imagecreatefromwbmp($hotel_icon);
32
        break;
33
    default:
34
        echo "ERROR:image type error " . $hotel_icon;
35
        exit(0);
36
        break;
37
}
38
39
$width  = imageSX($img);
40
$height = imageSY($img);