Index: trunk/phase3/includes/ImagePage.php |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | global $wgOut, $wgUser, $wgImageLimits, $wgRequest, |
45 | 45 | $wgUseImageResize, $wgRepositoryBaseUrl; |
46 | 46 | $this->img = Image::newFromTitle( $this->mTitle ); |
47 | | - $url = $this->img->getViewURL(); |
| 47 | + $full_url = $this->img->getViewURL(); |
48 | 48 | $anchoropen = ''; |
49 | 49 | $anchorclose = ''; |
50 | 50 | if ( $wgUseImageResize ) { |
— | — | @@ -71,26 +71,25 @@ |
72 | 72 | $height = $this->img->getHeight(); |
73 | 73 | $msg = wfMsg('showbigimage', $width, $height, intval( $this->img->getSize()/1024 ) ); |
74 | 74 | if ( $width > $maxWidth && $wgUseImageResize ) { |
75 | | - $anchoropen = "<a href=\"{$url}\">"; |
76 | | - $anchorclose = "<br>{$msg}</a>"; |
77 | | - |
78 | | - $url = $this->img->createThumb( $maxWidth ); |
79 | 75 | $height = floor( $height * $maxWidth / $width ); |
80 | 76 | $width = $maxWidth; |
81 | 77 | } |
82 | 78 | if ( $height > $maxHeight && $wgUseImageResize ) { |
83 | | - $anchoropen = "<a href=\"{$url}\">"; |
84 | | - $anchorclose = "<br>{$msg}</a>"; |
85 | | - |
86 | 79 | $width = floor( $width * $maxHeight / $height ); |
87 | 80 | $height = $maxHeight; |
| 81 | + } |
| 82 | + if ( $width != $this->img->getWidth() || $height != $this->img->getHeight() ) { |
88 | 83 | $url = $this->img->createThumb( $width ); |
| 84 | + $anchoropen = "<a href=\"{$full_url}\">"; |
| 85 | + $anchorclose = "<br>{$msg}</a>"; |
| 86 | + } else { |
| 87 | + $url = $full_url; |
89 | 88 | } |
90 | | - $s = "<div class=\"fullImageLink\">" . $anchoropen . |
| 89 | + $s = '<div class="fullImageLink">' . $anchoropen . |
91 | 90 | "<img border=\"0\" src=\"{$url}\" width=\"{$width}\" height=\"{$height}\" alt=\"" . |
92 | | - htmlspecialchars( $wgRequest->getVal( 'image' ) )."\" />" . $anchorclose . "</div>"; |
| 91 | + htmlspecialchars( $wgRequest->getVal( 'image' ) ).'" />' . $anchorclose . '</div>'; |
93 | 92 | } else { |
94 | | - $s = "<div class=\"fullMedia\">".$sk->makeMediaLink($this->img->getName(),"")."</div>"; |
| 93 | + $s = "<div class=\"fullMedia\">" . $sk->makeMediaLink( $this->img->getName(),'' ) . '</div>'; |
95 | 94 | } |
96 | 95 | $wgOut->addHTML( $s ); |
97 | 96 | if($this->img->fromSharedDirectory) { |