Code Duplication    Length = 5-5 lines in 3 locations

lib/private/legacy/image.php 3 locations

@@ 889-893 (lines=5) @@
886
		}
887
888
		// preserve transparency
889
		if ($this->imageType == IMAGETYPE_GIF or $this->imageType == IMAGETYPE_PNG) {
890
			imagecolortransparent($process, imagecolorallocatealpha($process, 0, 0, 0, 127));
891
			imagealphablending($process, false);
892
			imagesavealpha($process, true);
893
		}
894
895
		imagecopyresampled($process, $this->resource, 0, 0, 0, 0, $width, $height, $widthOrig, $heightOrig);
896
		if ($process == false) {
@@ 947-951 (lines=5) @@
944
		}
945
946
		// preserve transparency
947
		if ($this->imageType == IMAGETYPE_GIF or $this->imageType == IMAGETYPE_PNG) {
948
			imagecolortransparent($process, imagecolorallocatealpha($process, 0, 0, 0, 127));
949
			imagealphablending($process, false);
950
			imagesavealpha($process, true);
951
		}
952
953
		imagecopyresampled($process, $this->resource, 0, 0, $x, $y, $targetWidth, $targetHeight, $width, $height);
954
		if ($process == false) {
@@ 986-990 (lines=5) @@
983
		}
984
985
		// preserve transparency
986
		if ($this->imageType == IMAGETYPE_GIF or $this->imageType == IMAGETYPE_PNG) {
987
			imagecolortransparent($process, imagecolorallocatealpha($process, 0, 0, 0, 127));
988
			imagealphablending($process, false);
989
			imagesavealpha($process, true);
990
		}
991
992
		imagecopyresampled($process, $this->resource, 0, 0, $x, $y, $w, $h, $w, $h);
993
		if ($process == false) {