Code Duplication    Length = 5-5 lines in 3 locations

lib/private/legacy/image.php 3 locations

@@ 864-868 (lines=5) @@
861
		}
862
863
		// preserve transparency
864
		if ($this->imageType == IMAGETYPE_GIF or $this->imageType == IMAGETYPE_PNG) {
865
			imagecolortransparent($process, imagecolorallocatealpha($process, 0, 0, 0, 127));
866
			imagealphablending($process, false);
867
			imagesavealpha($process, true);
868
		}
869
870
		imagecopyresampled($process, $this->resource, 0, 0, 0, 0, $width, $height, $widthOrig, $heightOrig);
871
		if ($process == false) {
@@ 922-926 (lines=5) @@
919
		}
920
921
		// preserve transparency
922
		if ($this->imageType == IMAGETYPE_GIF or $this->imageType == IMAGETYPE_PNG) {
923
			imagecolortransparent($process, imagecolorallocatealpha($process, 0, 0, 0, 127));
924
			imagealphablending($process, false);
925
			imagesavealpha($process, true);
926
		}
927
928
		imagecopyresampled($process, $this->resource, 0, 0, $x, $y, $targetWidth, $targetHeight, $width, $height);
929
		if ($process == false) {
@@ 961-965 (lines=5) @@
958
		}
959
960
		// preserve transparency
961
		if ($this->imageType == IMAGETYPE_GIF or $this->imageType == IMAGETYPE_PNG) {
962
			imagecolortransparent($process, imagecolorallocatealpha($process, 0, 0, 0, 127));
963
			imagealphablending($process, false);
964
			imagesavealpha($process, true);
965
		}
966
967
		imagecopyresampled($process, $this->resource, 0, 0, $x, $y, $w, $h, $w, $h);
968
		if ($process == false) {