Code Duplication    Length = 4-8 lines in 2 locations

includes/media/DjVu.php 1 location

@@ 168-175 (lines=8) @@
165
			return new ThumbnailImage( $image, $dstUrl, $dstPath, $params );
166
		}
167
168
		if ( !wfMkdirParents( dirname( $dstPath ), null, __METHOD__ ) ) {
169
			return new MediaTransformError(
170
				'thumbnail_error',
171
				$width,
172
				$height,
173
				wfMessage( 'thumbnail_dest_directory' )->text()
174
			);
175
		}
176
177
		// Get local copy source for shell scripts
178
		// Thumbnail extraction is very inefficient for large files.

includes/media/SVG.php 1 location

@@ 186-189 (lines=4) @@
183
			return new MediaTransformError( 'thumbnail_error', $clientWidth, $clientHeight, $err );
184
		}
185
186
		if ( !wfMkdirParents( dirname( $dstPath ), null, __METHOD__ ) ) {
187
			return new MediaTransformError( 'thumbnail_error', $clientWidth, $clientHeight,
188
				wfMessage( 'thumbnail_dest_directory' )->text() );
189
		}
190
191
		$srcPath = $image->getLocalRefPath();
192
		if ( $srcPath === false ) { // Failed to get local copy