Code Duplication    Length = 10-10 lines in 2 locations

lib/private/legacy/image.php 2 locations

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