Code Duplication    Length = 16-16 lines in 2 locations

lib/private/Files/Node/File.php 1 location

@@ 149-164 (lines=16) @@
146
	 * @return IImage
147
	 * @since 10.1.0
148
	 */
149
	public function getThumbnail($options) {
150
		$maxX = array_key_exists('x', $options) ? (int)$options['x'] : 32;
151
		$maxY = array_key_exists('y', $options) ? (int)$options['y'] : 32;
152
		$scalingUp = array_key_exists('scalingup', $options) ? (bool)$options['scalingup'] : true;
153
		$keepAspect = array_key_exists('a', $options) ? true : false;
154
		$mode = array_key_exists('mode', $options) ? $options['mode'] : 'fill';
155
156
		$preview = new \OC\Preview();
157
		$preview->setFile($this);
158
		$preview->setMaxX($maxX);
159
		$preview->setMaxY($maxY);
160
		$preview->setScalingUp($scalingUp);
161
		$preview->setMode($mode);
162
		$preview->setKeepAspect($keepAspect);
163
		return $preview->getPreview();
164
	}
165
}
166

lib/private/Files/Meta/MetaFileVersionNode.php 1 location

@@ 160-175 (lines=16) @@
157
	 * @return IImage
158
	 * @since 10.1.0
159
	 */
160
	public function getThumbnail($options) {
161
		$maxX = array_key_exists('x', $options) ? (int)$options['x'] : 32;
162
		$maxY = array_key_exists('y', $options) ? (int)$options['y'] : 32;
163
		$scalingUp = array_key_exists('scalingup', $options) ? (bool)$options['scalingup'] : true;
164
		$keepAspect = array_key_exists('a', $options) ? true : false;
165
		$mode = array_key_exists('mode', $options) ? $options['mode'] : 'fill';
166
167
		$preview = new Preview();
168
		$preview->setFile($this, $this->versionId);
169
		$preview->setMaxX($maxX);
170
		$preview->setMaxY($maxY);
171
		$preview->setScalingUp($scalingUp);
172
		$preview->setMode($mode);
173
		$preview->setKeepAspect($keepAspect);
174
		return $preview->getPreview();
175
	}
176
}
177