= 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 ); if ( $img ) { if ( ! is_null( $page ) ) { $img->selectPage( $page ); } $thumb = $img->renderThumb( $width, false ); } else { $thumb = false; } if ( $img->lastError && $img->lastError !== true ) { header( 'HTTP/1.0 500 Internal Server Error' ); echo "

Thumbnail generation error

" . htmlspecialchars( $img->lastError ) . "
" . wfHostname() . "

"; } elseif ( $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(); ?>