From: Gabriel Wicke Date: Sat, 25 Apr 2015 20:03:20 +0000 (-0700) Subject: Don't load XML metadata on DjVu thumb generation X-Git-Tag: 1.31.0-rc.0~11588 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=71107e750250bf120b4b186f63da47301abc81af;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 ); }