= filemtime( $imagePath ) ) { wfStreamFile( $thumbPath ); // Can't log profiling data with no Setup.php exit; } // OK, no valid thumbnail, time to get out the heavy machinery wfProfileOut( 'thumb.php-start' ); require_once( 'Setup.php' ); wfProfileIn( 'thumb.php-render' ); $img = Image::newFromName( $fileName ); try { if ( $img ) { if ( ! is_null( $page ) ) { $img->selectPage( $page ); } $thumb = $img->renderThumb( $width, false ); } else { $thumb = false; } } catch( Exception $ex ) { // Tried to select a page on a non-paged file? $thumb = false; } if ( $thumb && $thumb->path ) { wfStreamFile( $thumb->path ); } else { $badtitle = wfMsg( 'badtitle' ); $badtitletext = wfMsg( 'badtitletext' ); echo " $badtitle

$badtitle

$badtitletext

"; } wfProfileOut( 'thumb.php-render' ); wfProfileOut( 'thumb.php' ); wfLogProfilingData(); ?>