$name = $this->mTitle->getText();
$path = wfImagePath( $name );
$url = wfImageUrl( $name );
-
- list($width, $height, $type, $attr) = getimagesize( $path );
- $sk = $wgUser->getSkin();
+ if ( file_exists( $path ) ) {
+ list($width, $height, $type, $attr) = getimagesize( $path );
- if ( $type != "" ) {
- # image
- $s .= "<center><img src=\"{$url}\" width=\"{$width}\" height=\"{$height}\"></center>";
- } else {
- $s .= "<center>".$sk->makeMediaLink($name,"")."</center>";
+ $sk = $wgUser->getSkin();
+
+ if ( $type != "" ) {
+ # image
+ $s .= "<center><img src=\"{$url}\" width=\"{$width}\" height=\"{$height}\"></center>";
+ } else {
+ $s .= "<center>".$sk->makeMediaLink($name,"")."</center>";
+ }
+ $wgOut->AddHTML( $s );
}
- $wgOut->AddHTML( $s );
}
function closeShowImage()
$thumbPath = wfImageArchiveDir( $thumbName, "thumb" )."/".$thumbName;
$thumbUrl = wfImageArchiveUrl( $thumbName, "thumb" );
- if ( (! file_exists( $thumbPath ))
+ if ( (! file_exists( $thumbPath ) && file_exists( $imgPath ))
|| ( filemtime($thumbPath) < filemtime($imgPath) ) ) {
if ( $wgUseImageMagick ) {
# use ImageMagick