Code Duplication    Length = 5-5 lines in 2 locations

lib/private/image.php 2 locations

@@ 880-884 (lines=5) @@
877
		}
878
879
		imagecopyresampled($process, $this->resource, 0, 0, $x, $y, $targetWidth, $targetHeight, $width, $height);
880
		if ($process == false) {
881
			$this->logger->error('OC_Image->centerCrop, Error re-sampling process image ' . $width . 'x' . $height, array('app' => 'core'));
882
			imagedestroy($process);
883
			return false;
884
		}
885
		imagedestroy($this->resource);
886
		$this->resource = $process;
887
		return true;
@@ 919-923 (lines=5) @@
916
		}
917
918
		imagecopyresampled($process, $this->resource, 0, 0, $x, $y, $w, $h, $w, $h);
919
		if ($process == false) {
920
			$this->logger->error(__METHOD__ . '(): Error re-sampling process image ' . $w . 'x' . $h, array('app' => 'core'));
921
			imagedestroy($process);
922
			return false;
923
		}
924
		imagedestroy($this->resource);
925
		$this->resource = $process;
926
		return true;