Code Duplication    Length = 5-5 lines in 3 locations

main/inc/lib/image.lib.php 3 locations

@@ 429-433 (lines=5) @@
426
        $type = $this->type;
427
        switch ($type) {
428
            case 'jpeg':
429
            case 'jpg':
430
                $src = @imagecreatefromjpeg($this->path);
431
                @imagecopy($dest, $src, 0, 0, $x, $y, $src_width, $src_height);
432
                @imagejpeg($dest, $this->path);
433
                break;
434
            case 'png':
435
                $src = @imagecreatefrompng($this->path);
436
                @imagecopy($dest, $src, 0, 0, $x, $y, $src_width, $src_height);
@@ 434-438 (lines=5) @@
431
                @imagecopy($dest, $src, 0, 0, $x, $y, $src_width, $src_height);
432
                @imagejpeg($dest, $this->path);
433
                break;
434
            case 'png':
435
                $src = @imagecreatefrompng($this->path);
436
                @imagecopy($dest, $src, 0, 0, $x, $y, $src_width, $src_height);
437
                @imagepng($dest, $this->path);
438
                break;
439
            case 'gif':
440
                $src = @imagecreatefromgif($this->path);
441
                @imagecopy($dest, $src, 0, 0, $x, $y, $src_width, $src_height);
@@ 439-443 (lines=5) @@
436
                @imagecopy($dest, $src, 0, 0, $x, $y, $src_width, $src_height);
437
                @imagepng($dest, $this->path);
438
                break;
439
            case 'gif':
440
                $src = @imagecreatefromgif($this->path);
441
                @imagecopy($dest, $src, 0, 0, $x, $y, $src_width, $src_height);
442
                @imagegif($dest, $this->path);
443
                break;
444
            default:
445
                return 0;
446
        }