From aff0023035875a339d0ddb93e75cad9f1eb9830a Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 13 Sep 2005 01:27:21 +0000 Subject: [PATCH] * 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 --- RELEASE-NOTES | 3 +++ includes/ImagePage.php | 23 ++++++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 46afa73a97..dfbf3e02bc 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/ImagePage.php b/includes/ImagePage.php index c056c47bf7..cda3c9677e 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -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 = ""; - $anchorclose = "
\n$anchoropen{$msg}"; + $anchorclose = "
"; + if( $this->img->mustRender() ) { + $showLink = true; + } else { + $anchorclose .= "\n$anchoropen{$msg}"; + } } else { - $url = $full_url; - $showLink = $this->img->mustRender(); + $url = $this->img->getViewURL(); + $showLink = true; } $wgOut->addHTML( '' ); } - + $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( <<