Code Duplication    Length = 5-5 lines in 2 locations

lib/private/Preview.php 2 locations

@@ 1002-1006 (lines=5) @@
999
	 * @param int $previewHeight
1000
	 */
1001
	private function cropAndFill($image, $askedWidth, $askedHeight, $previewWidth, $previewHeight) {
1002
		if ($previewWidth > $askedWidth) {
1003
			$cropX = floor(($previewWidth - $askedWidth) * 0.5);
1004
			$image->crop($cropX, 0, $askedWidth, $previewHeight);
1005
			$previewWidth = $askedWidth;
1006
		}
1007
1008
		if ($previewHeight > $askedHeight) {
1009
			$cropY = floor(($previewHeight - $askedHeight) * 0.5);
@@ 1008-1012 (lines=5) @@
1005
			$previewWidth = $askedWidth;
1006
		}
1007
1008
		if ($previewHeight > $askedHeight) {
1009
			$cropY = floor(($previewHeight - $askedHeight) * 0.5);
1010
			$image->crop(0, $cropY, $previewWidth, $askedHeight);
1011
			$previewHeight = $askedHeight;
1012
		}
1013
1014
		// Creates a transparent background
1015
		$backgroundLayer = imagecreatetruecolor($askedWidth, $askedHeight);