Code Duplication    Length = 6-6 lines in 2 locations

lib/private/Preview.php 2 locations

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