Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F8270
patch.txt
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 11:56 PM
2014-11-21 23:56:29 (UTC+0)
Size
2 KB
Referenced Files
None
Subscribers
None
patch.txt
View Options
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( '<div class="fullImageLink" id="file">' .
$thumbnail->toHtml( $options ) .
@@ -428,8 +436,8 @@
if ( $showLink ) {
$filename = wfEscapeWikiText( $this->displayImg->getName() );
$linktext = $filename;
- if ( isset( $msgbig ) ) {
- $linktext = wfEscapeWikiText( $msgbig );
+ if ( $addFullResolutionLink ) {
+ $linktext = wfMsg( 'show-big-image' );
}
$medialink = "[[Media:$filename|$linktext]]";
@@ -484,7 +492,7 @@
* @param int $width
* @param int $height
*/
- private function makeSizeLink( $params, $width, $height ) {
+ private function makeSizeLink( $params, $width, $height, $msg = 'show-big-image-size' ) {
$params['width'] = $width;
$params['height'] = $height;
$thumbnail = $this->displayImg->transform( $params );
@@ -492,7 +500,7 @@
return Html::rawElement( 'a', array(
'href' => $thumbnail->getUrl(),
'class' => 'mw-thumbnail-link'
- ), wfMessage( 'show-big-image-size' )->numParams(
+ ), wfMessage( $msg )->numParams(
$thumbnail->getWidth(), $thumbnail->getHeight()
)->parse() );
} else {
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
7794
Default Alt Text
patch.txt (2 KB)
Attached To
Mode
T33366: File description page thumbnail click versus EXIF rotation, mustRender()
Attached
Detach File
Event Timeline
Log In to Comment