* @public
*/
function getThumbnail( $width, $height=-1, $render = true ) {
+ wfProfileIn( __METHOD__ );
if ($this->canRender()) {
if ( $height > 0 ) {
$this->load();
}
}
if ( $render ) {
- return $this->renderThumb( $width );
+ $thumb = $this->renderThumb( $width );
} else {
// Don't render, just return the URL
if ( $this->validateThumbParams( $width, $height ) ) {
} else {
list( $isScriptUrl, $url ) = $this->thumbUrl( $width );
}
- return new ThumbnailImage( $url, $width, $height );
+ $thumb = new ThumbnailImage( $url, $width, $height );
} else {
- return null;
+ $thumb = null;
}
}
} else {
// not a bitmap or renderable image, don't try.
- return $this->iconThumb();
+ $thumb = $this->iconThumb();
}
+ wfProfileOut( __METHOD__ );
+ return $thumb;
}
/**
$height = -1;
if ( !$this->validateThumbParams( $width, $height ) ) {
# Validation error
+ wfProfileOut( __METHOD__ );
return null;
}