Code Duplication    Length = 5-5 lines in 2 locations

lib/private/legacy/image.php 2 locations

@@ 929-933 (lines=5) @@
926
		}
927
928
		imagecopyresampled($process, $this->resource, 0, 0, $x, $y, $targetWidth, $targetHeight, $width, $height);
929
		if ($process == false) {
930
			$this->logger->error('OC_Image->centerCrop, Error re-sampling process image ' . $width . 'x' . $height, array('app' => 'core'));
931
			imagedestroy($process);
932
			return false;
933
		}
934
		imagedestroy($this->resource);
935
		$this->resource = $process;
936
		return true;
@@ 968-972 (lines=5) @@
965
		}
966
967
		imagecopyresampled($process, $this->resource, 0, 0, $x, $y, $w, $h, $w, $h);
968
		if ($process == false) {
969
			$this->logger->error(__METHOD__ . '(): Error re-sampling process image ' . $w . 'x' . $h, array('app' => 'core'));
970
			imagedestroy($process);
971
			return false;
972
		}
973
		imagedestroy($this->resource);
974
		$this->resource = $process;
975
		return true;