* Use the real file link instead of the default-size rasterized version for
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 13 Sep 2005 01:27:21 +0000 (01:27 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 13 Sep 2005 01:27:21 +0000 (01:27 +0000)
  large SVG images on image description page
* Include the file name/type/size line for non-resized images

RELEASE-NOTES
includes/ImagePage.php

index 46afa73..dfbf3e0 100644 (file)
@@ -98,6 +98,9 @@ fully support the editing toolbar, but was found to be too confusing.
 * (bug 3448) Set page_len on undelete
 * (bug 3405) Don't use raw letters as aliases of MSGNW: and SUBST:
 * (bug 2800) Don't scale up small images on |thumb| without explicit size
+* Use the real file link instead of the default-size rasterized version for
+  large SVG images on image description page
+* Include the file name/type/size line for non-resized images
 
 
 === Caveats ===
index c056c47..cda3c96 100644 (file)
@@ -132,7 +132,7 @@ class ImagePage extends Article {
                global $wgOut, $wgUser, $wgImageLimits, $wgRequest,
                       $wgUseImageResize, $wgRepositoryBaseUrl,
                       $wgUseExternalEditor, $wgServer, $wgFetchCommonsDescriptions;
-               $full_url  = $this->img->getViewURL();
+               $full_url  = $this->img->getURL();
                $anchoropen = '';
                $anchorclose = '';
 
@@ -172,20 +172,25 @@ class ImagePage extends Article {
                                        if( $wgUseImageResize ) {
                                                $thumbnail = $this->img->getThumbnail( $width );
                                                if ( $thumbnail == null ) {
-                                                       $url = $full_url;
+                                                       $url = $img->getViewURL();
                                                } else {
-                                                       $url = $thumbnail->getUrl();
+                                                       $url = $thumbnail->getURL();
                                                }
                                        } else {
                                                # No resize ability? Show the full image, but scale
                                                # it down in the browser so it fits on the page.
-                                               $url = $full_url;
+                                               $url = $img->getViewURL();
                                        }
                                        $anchoropen  = "<a href=\"{$full_url}\">";
-                                       $anchorclose = "</a><br />\n$anchoropen{$msg}</a>";
+                                       $anchorclose = "</a><br />";
+                                       if( $this->img->mustRender() ) {
+                                               $showLink = true;
+                                       } else {
+                                               $anchorclose .= "\n$anchoropen{$msg}</a>";
+                                       }
                                } else {
-                                       $url = $full_url;
-                                       $showLink = $this->img->mustRender();
+                                       $url = $this->img->getViewURL();
+                                       $showLink = true;
                                }
                                $wgOut->addHTML( '<div class="fullImageLink" id="file">' . $anchoropen .
                                     "<img border=\"0\" src=\"{$url}\" width=\"{$width}\" height=\"{$height}\" alt=\"" .
@@ -199,7 +204,7 @@ class ImagePage extends Article {
                                        $icon->toHtml() .
                                        '</a></div>' );
                                }
-
+                               
                                $showLink = true;
                        }
 
@@ -209,7 +214,7 @@ class ImagePage extends Article {
                                $info = wfMsg( 'fileinfo',
                                        ceil($this->img->getSize()/1024.0),
                                        $this->img->getMimeType() );
-
+       
                                if (!$this->img->isSafeFile()) {
                                        $warning = wfMsg( 'mediawarning' );
                                        $wgOut->addWikiText( <<<END