Code Duplication    Length = 5-5 lines in 3 locations

lib/private/image.php 3 locations

@@ 815-819 (lines=5) @@
812
		}
813
814
		// preserve transparency
815
		if ($this->imageType == IMAGETYPE_GIF or $this->imageType == IMAGETYPE_PNG) {
816
			imagecolortransparent($process, imagecolorallocatealpha($process, 0, 0, 0, 127));
817
			imagealphablending($process, false);
818
			imagesavealpha($process, true);
819
		}
820
821
		imagecopyresampled($process, $this->resource, 0, 0, 0, 0, $width, $height, $widthOrig, $heightOrig);
822
		if ($process == false) {
@@ 873-877 (lines=5) @@
870
		}
871
872
		// preserve transparency
873
		if ($this->imageType == IMAGETYPE_GIF or $this->imageType == IMAGETYPE_PNG) {
874
			imagecolortransparent($process, imagecolorallocatealpha($process, 0, 0, 0, 127));
875
			imagealphablending($process, false);
876
			imagesavealpha($process, true);
877
		}
878
879
		imagecopyresampled($process, $this->resource, 0, 0, $x, $y, $targetWidth, $targetHeight, $width, $height);
880
		if ($process == false) {
@@ 912-916 (lines=5) @@
909
		}
910
911
		// preserve transparency
912
		if ($this->imageType == IMAGETYPE_GIF or $this->imageType == IMAGETYPE_PNG) {
913
			imagecolortransparent($process, imagecolorallocatealpha($process, 0, 0, 0, 127));
914
			imagealphablending($process, false);
915
			imagesavealpha($process, true);
916
		}
917
918
		imagecopyresampled($process, $this->resource, 0, 0, $x, $y, $w, $h, $w, $h);
919
		if ($process == false) {