-$errorMsg = false;
-if ( !$img ) {
- $errorMsg = wfMsg( 'badtitletext' );
-} elseif ( !$thumb ) {
- $errorMsg = wfMsgHtml( 'thumbnail_error', 'File::transform() returned false' );
-} elseif ( $thumb->isError() ) {
- $errorMsg = $thumb->getHtmlMsg();
-} elseif ( !$thumb->getPath() ) {
- $errorMsg = wfMsgHtml( 'thumbnail_error', 'No path supplied in thumbnail object' );
-} elseif ( $thumb->getPath() == $img->getPath() ) {
- $errorMsg = wfMsgHtml( 'thumbnail_error', 'Image was not scaled, ' .
- 'is the requested width bigger than the source?' );
-} else {
- wfStreamFile( $thumb->getPath() );
-}
-if ( $errorMsg !== false ) {
- thumbInternalError( $errorMsg );
-}
-
-wfProfileOut( 'thumb.php-render' );
-wfProfileOut( 'thumb.php' );
-wfLogProfilingData();
+ $errorMsg = false;
+ if ( !$thumb ) {
+ $errorMsg = wfMsgHtml( 'thumbnail_error', 'File::transform() returned false' );
+ } elseif ( $thumb->isError() ) {
+ $errorMsg = $thumb->getHtmlMsg();
+ } elseif ( !$thumb->getPath() ) {
+ $errorMsg = wfMsgHtml( 'thumbnail_error', 'No path supplied in thumbnail object' );
+ } elseif ( $thumb->getPath() == $img->getPath() ) {
+ $errorMsg = wfMsgHtml( 'thumbnail_error', 'Image was not scaled, ' .
+ 'is the requested width bigger than the source?' );
+ } else {
+ wfStreamFile( $thumb->getPath() );
+ }
+ if ( $errorMsg !== false ) {
+ wfThumbError( 500, $errorMsg );
+ }