Code Duplication    Length = 6-6 lines in 2 locations

lib/private/Preview.php 2 locations

@@ 594-599 (lines=6) @@
591
		$askedWidth = min($askedWidth, $originalWidth * $scaleFactor);
592
		$askedHeight = min($askedHeight, $originalHeight * $scaleFactor);
593
594
		if ($askedWidth / $originalRatio < $askedHeight) {
595
			// width restricted
596
			$askedHeight = round($askedWidth / $originalRatio);
597
		} else {
598
			$askedWidth = round($askedHeight * $originalRatio);
599
		}
600
601
		return [(int)$askedWidth, (int)$askedHeight];
602
	}
@@ 620-625 (lines=6) @@
617
		$askedWidth = min($askedWidth, $previewWidth * $scaleFactor);
618
		$askedHeight = min($askedHeight, $previewHeight * $scaleFactor);
619
620
		if ($askedWidth / $originalRatio > $askedHeight) {
621
			// height restricted
622
			$askedHeight = round($askedWidth / $originalRatio);
623
		} else {
624
			$askedWidth = round($askedHeight * $originalRatio);
625
		}
626
627
		return [(int)$askedWidth, (int)$askedHeight];
628
	}