Code Duplication    Length = 5-5 lines in 3 locations

lib/private/legacy/image.php 3 locations

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