Don't check if the thumbnail file exists if $wgGenerateThumbnailOnParse=false. Ineffi...
authorTim Starling <tstarling@users.mediawiki.org>
Thu, 10 May 2007 15:03:41 +0000 (15:03 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Thu, 10 May 2007 15:03:41 +0000 (15:03 +0000)
includes/Image.php

index 0ea6d92..7529b8d 100644 (file)
@@ -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