r22064 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22063‎ | r22064 | r22065 >
Date:15:03, 10 May 2007
Author:tstarling
Status:old
Tags:
Comment:
Don't check if the thumbnail file exists if $wgGenerateThumbnailOnParse=false. Inefficient.
Modified paths:
  • /trunk/phase3/includes/Image.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Image.php
@@ -927,15 +927,15 @@
928928
929929 $this->migrateThumbFile( $thumbName );
930930
931 - if ( file_exists( $thumbPath ) ) {
 931+ if ( !$wgGenerateThumbnailOnParse && !($flags & self::RENDER_NOW ) ) {
932932 $thumb = $handler->getTransform( $this, $thumbPath, $thumbUrl, $params );
933933 break;
934934 }
935 -
936 - if ( !$wgGenerateThumbnailOnParse && !($flags & self::RENDER_NOW ) ) {
 935+ if ( file_exists( $thumbPath ) ) {
937936 $thumb = $handler->getTransform( $this, $thumbPath, $thumbUrl, $params );
938937 break;
939938 }
 939+
940940 $thumb = $handler->doTransform( $this, $thumbPath, $thumbUrl, $params );
941941
942942 // Ignore errors if requested