Code Duplication    Length = 5-5 lines in 2 locations

lib/private/legacy/image.php 2 locations

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