Index: includes/ImagePage.php =================================================================== --- includes/ImagePage.php (revision 99223) +++ includes/ImagePage.php (working copy) @@ -287,6 +287,9 @@ $width = $width_orig; $height_orig = $this->displayImg->getHeight( $page ); $height = $height_orig; + $mustRender = $this->displayImg->getHandler() && + $this->displayImg->getHandler()->mustRender( $this->displayImg ); + $addFullResolutionLink = false; $longDesc = wfMsg( 'parentheses', $this->displayImg->getLongDesc() ); @@ -312,14 +315,19 @@ # Note that $height <= $maxHeight now, but might not be identical # because of rounding. } - $msgbig = wfMsgHtml( 'show-big-image' ); + $otherSizes = array(); foreach ( $wgImageLimits as $size ) { if ( $size[0] < $width_orig && $size[1] < $height_orig && $size[0] != $width && $size[1] != $height ) { $otherSizes[] = $this->makeSizeLink( $params, $size[0], $size[1] ); - } + } } + if ( $mustRender ) { + $otherSizes[] = $this->makeSizeLink( $params, $width_orig, $height_orig, 'show-big-image' ); + } else { + $addFullResolutionLink = true; + } $msgsmall = wfMessage( 'show-big-image-preview' )-> rawParams( $this->makeSizeLink( $params, $width, $height ) )-> parse() . ' ' . @@ -347,7 +355,7 @@ if ( $thumbnail ) { $options = array( 'alt' => $this->displayImg->getTitle()->getPrefixedText(), - 'file-link' => true, + 'file-link' => !$mustRender, ); $wgOut->addHTML( '