Code Duplication    Length = 10-10 lines in 2 locations

lib/private/legacy/image.php 2 locations

@@ 526-535 (lines=10) @@
523
		}
524
		$iType = exif_imagetype($imagePath);
525
		switch ($iType) {
526
			case IMAGETYPE_GIF:
527
				if (imagetypes() & IMG_GIF) {
528
					$this->resource = imagecreatefromgif($imagePath);
529
					// Preserve transparency
530
					imagealphablending($this->resource, true);
531
					imagesavealpha($this->resource, true);
532
				} else {
533
					$this->logger->debug('OC_Image->loadFromFile, GIF images not supported: ' . $imagePath, array('app' => 'core'));
534
				}
535
				break;
536
			case IMAGETYPE_JPEG:
537
				if (imagetypes() & IMG_JPG) {
538
					$this->resource = imagecreatefromjpeg($imagePath);
@@ 543-552 (lines=10) @@
540
					$this->logger->debug('OC_Image->loadFromFile, JPG images not supported: ' . $imagePath, array('app' => 'core'));
541
				}
542
				break;
543
			case IMAGETYPE_PNG:
544
				if (imagetypes() & IMG_PNG) {
545
					$this->resource = imagecreatefrompng($imagePath);
546
					// Preserve transparency
547
					imagealphablending($this->resource, true);
548
					imagesavealpha($this->resource, true);
549
				} else {
550
					$this->logger->debug('OC_Image->loadFromFile, PNG images not supported: ' . $imagePath, array('app' => 'core'));
551
				}
552
				break;
553
			case IMAGETYPE_XBM:
554
				if (imagetypes() & IMG_XPM) {
555
					$this->resource = imagecreatefromxbm($imagePath);