Code Duplication    Length = 6-6 lines in 2 locations

lib/private/Preview.php 2 locations

@@ 580-585 (lines=6) @@
577
		$askedWidth = \min($askedWidth, $originalWidth * $scaleFactor);
578
		$askedHeight = \min($askedHeight, $originalHeight * $scaleFactor);
579
580
		if ($askedWidth / $originalRatio < $askedHeight) {
581
			// width restricted
582
			$askedHeight = \round($askedWidth / $originalRatio);
583
		} else {
584
			$askedWidth = \round($askedHeight * $originalRatio);
585
		}
586
587
		return [(int)$askedWidth, (int)$askedHeight];
588
	}
@@ 606-611 (lines=6) @@
603
		$askedWidth = \min($askedWidth, $previewWidth * $scaleFactor);
604
		$askedHeight = \min($askedHeight, $previewHeight * $scaleFactor);
605
606
		if ($askedWidth / $originalRatio > $askedHeight) {
607
			// height restricted
608
			$askedHeight = \round($askedWidth / $originalRatio);
609
		} else {
610
			$askedWidth = \round($askedHeight * $originalRatio);
611
		}
612
613
		return [(int)$askedWidth, (int)$askedHeight];
614
	}