Brian Wolff has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/86387


Change subject: Add the full resolution of a file to the list of "Other 
resolutions:"
......................................................................

Add the full resolution of a file to the list of "Other resolutions:"

There is a link below for the "Full Resolution" of the file, but I
think it is also good to also have this in with the size choices,
as the user may not realize the full resolution is not one of the
"other" resolution choices.

Additionally, some people have said it would be useful for tiff files
to have a link to a high resolution but converted to jpeg file.

See also gerrit change 86383. Bryan had a similar patch to this
on bug 31366

Change-Id: I771650017edee2f5e0240912835455f5ad62a9bb
---
M includes/ImagePage.php
1 file changed, 14 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/87/86387/1

diff --git a/includes/ImagePage.php b/includes/ImagePage.php
index 7ea06b0..18870ed 100644
--- a/includes/ImagePage.php
+++ b/includes/ImagePage.php
@@ -350,15 +350,27 @@
                                        $linktext = wfMessage( 'show-big-image' 
)->escaped();
                                        if ( 
$this->displayImg->getRepo()->canTransformVia404() ) {
                                                $thumbSizes = $wgImageLimits;
+                                               // Also include the full sized 
resolution in the list, so
+                                               // that users know they can get 
it. This will link to the
+                                               // original file asset if 
mustRender() === false. In the case
+                                               // that we mustRender, some 
users have indicated that they would
+                                               // find it useful to have the 
full size image in the rendered
+                                               // image format.
+                                               $thumbSizes[] = array( 
$width_orig, $height_orig );
                                        } else {
                                                # Creating thumb links triggers 
thumbnail generation.
                                                # Just generate the thumb for 
the current users prefs.
                                                $thumbSizes = array( 
$this->getImageLimitsFromOption( $user, 'thumbsize' ) );
+                                               if ( 
!$this->displayImg->mustRender() ) {
+                                                       // We can safely 
include a link to the "full-size" preview,
+                                                       // without actually 
rendering.
+                                                       $thumbSizes[] = array( 
$width_orig, $height_orig );
+                                               }
                                        }
                                        # Generate thumbnails or thumbnail 
links as needed...
                                        $otherSizes = array();
                                        foreach ( $thumbSizes as $size ) {
-                                               if ( $size[0] < $width_orig && 
$size[1] < $height_orig
+                                               if ( $size[0] <= $width_orig && 
$size[1] <= $height_orig
                                                        && $size[0] != $width 
&& $size[1] != $height )
                                                {
                                                        $sizeLink = 
$this->makeSizeLink( $params, $size[0], $size[1] );
@@ -367,6 +379,7 @@
                                                        }
                                                }
                                        }
+                                       $otherSizes = array_unique( $otherSizes 
);
                                        $msgsmall = '';
                                        $sizeLinkBigImagePreview = 
$this->makeSizeLink( $params, $width, $height );
                                        if ( $sizeLinkBigImagePreview ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/86387
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I771650017edee2f5e0240912835455f5ad62a9bb
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

Reply via email to