Code Duplication    Length = 6-6 lines in 2 locations

lib/private/Preview.php 2 locations

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