Code Duplication    Length = 5-5 lines in 2 locations

lib/private/legacy/image.php 2 locations

@@ 956-960 (lines=5) @@
953
		}
954
955
		imagecopyresampled($process, $this->resource, 0, 0, $x, $y, $targetWidth, $targetHeight, $width, $height);
956
		if ($process == false) {
957
			$this->logger->error('OC_Image->centerCrop, Error re-sampling process image ' . $width . 'x' . $height, array('app' => 'core'));
958
			imagedestroy($process);
959
			return false;
960
		}
961
		imagedestroy($this->resource);
962
		$this->resource = $process;
963
		return true;
@@ 995-999 (lines=5) @@
992
		}
993
994
		imagecopyresampled($process, $this->resource, 0, 0, $x, $y, $w, $h, $w, $h);
995
		if ($process == false) {
996
			$this->logger->error(__METHOD__ . '(): Error re-sampling process image ' . $w . 'x' . $h, array('app' => 'core'));
997
			imagedestroy($process);
998
			return false;
999
		}
1000
		imagedestroy($this->resource);
1001
		$this->resource = $process;
1002
		return true;