From 9530c06bf6292dabf4f92ecb08e23f790f3e59f1 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Thu, 10 May 2007 15:03:41 +0000 Subject: [PATCH] Don't check if the thumbnail file exists if $wgGenerateThumbnailOnParse=false. Inefficient. --- includes/Image.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.20.1