Code Duplication    Length = 10-10 lines in 2 locations

lib/private/legacy/image.php 2 locations

@@ 553-562 (lines=10) @@
550
		}
551
		$iType = exif_imagetype($imagePath);
552
		switch ($iType) {
553
			case IMAGETYPE_GIF:
554
				if (imagetypes() & IMG_GIF) {
555
					$this->resource = imagecreatefromgif($imagePath);
556
					// Preserve transparency
557
					imagealphablending($this->resource, true);
558
					imagesavealpha($this->resource, true);
559
				} else {
560
					$this->logger->debug('OC_Image->loadFromFile, GIF images not supported: ' . $imagePath, array('app' => 'core'));
561
				}
562
				break;
563
			case IMAGETYPE_JPEG:
564
				if (imagetypes() & IMG_JPG) {
565
					$this->resource = imagecreatefromjpeg($imagePath);
@@ 570-579 (lines=10) @@
567
					$this->logger->debug('OC_Image->loadFromFile, JPG images not supported: ' . $imagePath, array('app' => 'core'));
568
				}
569
				break;
570
			case IMAGETYPE_PNG:
571
				if (imagetypes() & IMG_PNG) {
572
					$this->resource = imagecreatefrompng($imagePath);
573
					// Preserve transparency
574
					imagealphablending($this->resource, true);
575
					imagesavealpha($this->resource, true);
576
				} else {
577
					$this->logger->debug('OC_Image->loadFromFile, PNG images not supported: ' . $imagePath, array('app' => 'core'));
578
				}
579
				break;
580
			case IMAGETYPE_XBM:
581
				if (imagetypes() & IMG_XPM) {
582
					$this->resource = imagecreatefromxbm($imagePath);