From 71107e750250bf120b4b186f63da47301abc81af Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Sat, 25 Apr 2015 13:03:20 -0700 Subject: [PATCH] Don't load XML metadata on DjVu thumb generation As described in T96360, scaling of DjVu files loads huge XML blobs from the database for no apparent reason. This caused several outages by overloading the database. This patch simply removes the XML fetching & associated check. Bug: T96360 Change-Id: I99d90b569bf9a6b6492ecca23b1b00267b0fa0ab --- includes/media/DjVu.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/includes/media/DjVu.php b/includes/media/DjVu.php index 1b0eb492bb..5f6b965097 100644 --- a/includes/media/DjVu.php +++ b/includes/media/DjVu.php @@ -137,17 +137,6 @@ class DjVuHandler extends ImageHandler { function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) { global $wgDjvuRenderer, $wgDjvuPostProcessor; - // Fetch XML and check it, to give a more informative error message than the one which - // normaliseParams will inevitably give. - $xml = $image->getMetadata(); - if ( !$xml ) { - $width = isset( $params['width'] ) ? $params['width'] : 0; - $height = isset( $params['height'] ) ? $params['height'] : 0; - - return new MediaTransformError( 'thumbnail_error', $width, $height, - wfMessage( 'djvu_no_xml' )->text() ); - } - if ( !$this->normaliseParams( $image, $params ) ) { return new TransformParameterError( $params ); } -- 2.20.1