Code Duplication    Length = 8-8 lines in 2 locations

lib/private/preview.php 1 location

@@ 632-639 (lines=8) @@
629
	 *
630
	 * @return \int[]
631
	 */
632
	private function fixSize($askedWidth, $askedHeight) {
633
		if ($this->scalingUp) {
634
			$askedWidth = min($this->configMaxWidth, $askedWidth);
635
			$askedHeight = min($this->configMaxHeight, $askedHeight);
636
		}
637
638
		return [(int)$askedWidth, (int)$askedHeight];
639
	}
640
641
	/**
642
	 * Checks if a bigger version of a file preview is cached and if not

tests/lib/preview.php 1 location

@@ 873-880 (lines=8) @@
870
	 *
871
	 * @return array
872
	 */
873
	private function fixSize($askedWidth, $askedHeight) {
874
		if ($this->scalingUp) {
875
			$askedWidth = min($this->configMaxWidth, $askedWidth);
876
			$askedHeight = min($this->configMaxHeight, $askedHeight);
877
		}
878
879
		return [(int)$askedWidth, (int)$askedHeight];
880
	}
881
882
	public function testKeepAspectRatio() {
883
		$originalWidth = 1680;