From: Tim Starling Date: Thu, 10 May 2007 15:03:41 +0000 (+0000) Subject: Don't check if the thumbnail file exists if $wgGenerateThumbnailOnParse=false. Ineffi... X-Git-Tag: 1.31.0-rc.0~52979 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=9530c06bf6292dabf4f92ecb08e23f790f3e59f1;p=lhc%2Fweb%2Fwiklou.git Don't check if the thumbnail file exists if $wgGenerateThumbnailOnParse=false. Inefficient. --- diff --git a/includes/Image.php b/includes/Image.php index 0ea6d9294f..7529b8d92f 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -927,15 +927,15 @@ class Image $this->migrateThumbFile( $thumbName ); - if ( file_exists( $thumbPath ) ) { + if ( !$wgGenerateThumbnailOnParse && !($flags & self::RENDER_NOW ) ) { $thumb = $handler->getTransform( $this, $thumbPath, $thumbUrl, $params ); break; } - - if ( !$wgGenerateThumbnailOnParse && !($flags & self::RENDER_NOW ) ) { + if ( file_exists( $thumbPath ) ) { $thumb = $handler->getTransform( $this, $thumbPath, $thumbUrl, $params ); break; } + $thumb = $handler->doTransform( $this, $thumbPath, $thumbUrl, $params ); // Ignore errors if requested