Brian Wolff has uploaded a new change for review.
https://gerrit.wikimedia.org/r/86383
Change subject: Make image on desc page not clickable if $file->mustRender()
true.
......................................................................
Make image on desc page not clickable if $file->mustRender() true.
There are two cases where this is an issue:
*Images rotated by exif. The thumb is rotated, but the full size
file is not.
*Images that aren't displayed by the browser (e.g. tiff)
Its rather bad UI that a user clicks on the image, gets prompted
to download a file, that they probably don't know what to do
with (allegedly quicktime often gets associated with tiff files)
Most people don't want this, and find it confusing. What they
are really trying to do is get a big version of the thumbnail.
This patch makes the image clickable, only if the original
version is viewable by the browser (e.g. mustRender is false).
Additionally instead of showing "Full resolution" link, it
shows a "View original file" link. I believe this is much
more inline with user expectations.
One possible complaint people might have, is SVG images are
no longer clickable to get to the original svg file. People
can of course still click on the link below the image.
I didn't realize this when I wrote this patch, but Bryan
had a patch on the bugzilla bug doing essentially the same thing.
The major difference is that his also included a converted link
to the full resolution of the file in the size of preview bar.
I think that's a good idea, but should be the subject of a
separate patch).
Bug: 31366
Change-Id: I24bc5ab8bb06c00989bca575f99faac05a6e72c6
---
M RELEASE-NOTES-1.22
M includes/ImagePage.php
M languages/messages/MessagesEn.php
M languages/messages/MessagesQqq.php
M maintenance/language/messages.inc
5 files changed, 11 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/83/86383/1
diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22
index c9bff69..7f98cd1 100644
--- a/RELEASE-NOTES-1.22
+++ b/RELEASE-NOTES-1.22
@@ -316,6 +316,8 @@
database is created.
* (bug 47191) Fixed "Column 'si_title' cannot be part of FULLTEXT index"
MySQL error when installing using the binary character set option.
+* (bug 31366) Files in a format not usually renderable in the browser
+ are no longer clickable on image description pages.
=== API changes in 1.22 ===
* (bug 25553) The JSON output formatter now leaves forward slashes unescaped
diff --git a/includes/ImagePage.php b/includes/ImagePage.php
index 7ea06b0..b6d677e 100644
--- a/includes/ImagePage.php
+++ b/includes/ImagePage.php
@@ -347,7 +347,11 @@
# Note that $height <=
$maxHeight now, but might not be identical
# because of rounding.
}
- $linktext = wfMessage( 'show-big-image'
)->escaped();
+ if ( $this->displayImg->mustRender() ) {
+ $linktext = wfMessage(
'show-big-image-original' )->escaped();
+ } else {
+ $linktext = wfMessage(
'show-big-image' )->escaped();
+ }
if (
$this->displayImg->getRepo()->canTransformVia404() ) {
$thumbSizes = $wgImageLimits;
} else {
@@ -408,7 +412,7 @@
if ( $thumbnail ) {
$options = array(
'alt' =>
$this->displayImg->getTitle()->getPrefixedText(),
- 'file-link' => true,
+ 'file-link' =>
!$this->displayImg->mustRender(),
);
$out->addHTML( '<div
class="fullImageLink" id="file">' .
$thumbnail->toHtml( $options ) .
diff --git a/languages/messages/MessagesEn.php
b/languages/messages/MessagesEn.php
index 529c2c8..68de301 100644
--- a/languages/messages/MessagesEn.php
+++ b/languages/messages/MessagesEn.php
@@ -3952,6 +3952,7 @@
'svg-long-desc-animated' => 'Animated SVG file, nominally $1 × $2 pixels,
file size: $3',
'svg-long-error' => 'Invalid SVG file: $1',
'show-big-image' => 'Full resolution',
+'show-big-image-original' => 'View original file',
'show-big-image-preview' => 'Size of this preview: $1.',
'show-big-image-other' => 'Other {{PLURAL:$2|resolution|resolutions}}:
$1.',
'show-big-image-size' => '$1 × $2 pixels',
diff --git a/languages/messages/MessagesQqq.php
b/languages/messages/MessagesQqq.php
index f50039d..bc2f226 100644
--- a/languages/messages/MessagesQqq.php
+++ b/languages/messages/MessagesQqq.php
@@ -8236,6 +8236,7 @@
See also:
* {{msg-mw|Thumbnail error}}',
'show-big-image' => 'Displayed under an image at the image description page,
when it is displayed smaller there than it was uploaded.',
+'show-big-image-original' => 'Like {{msg-mw|show-big-image}}. Displayed under
an image at the image description page, when it is displayed smaller there than
it was uploaded, and the file is of a type that usually cannot be viewed in the
browser (For example, a tiff image).',
'show-big-image-preview' => 'Message shown under the image description page
thumbnail.
Can be followed by {{msg-mw|Show-big-image-other}}.
diff --git a/maintenance/language/messages.inc
b/maintenance/language/messages.inc
index 991fc1b..fff2d7a 100644
--- a/maintenance/language/messages.inc
+++ b/maintenance/language/messages.inc
@@ -2877,6 +2877,7 @@
'svg-long-desc-animated',
'svg-long-error',
'show-big-image',
+ 'show-big-image-original',
'show-big-image-preview',
'show-big-image-other',
'show-big-image-size',
--
To view, visit https://gerrit.wikimedia.org/r/86383
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I24bc5ab8bb06c00989bca575f99faac05a6e72c6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits