From: Raimond Spekking Date: Tue, 20 Nov 2007 12:11:05 +0000 (+0000) Subject: * Do not present an image bigger than the source when 'frameless' option is used X-Git-Tag: 1.31.0-rc.0~50784 X-Git-Url: http://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=44c98ffac2fd6ebeabcc6e4b410bc559358141e9;p=lhc%2Fweb%2Fwiklou.git * Do not present an image bigger than the source when 'frameless' option is used * This is consistent with the 'thumb' option now: ** Unchanged: [[Image:xyz.jpg|thumb]], [[Image:xyz.jpg|thumb|200px]] do not blow up an image larger than the source ** Unchanged: [[Image:xyz.jpg|frameless]] does not blow up an image ** New: [[Image:xyz.jpg|frameless|200px]] does not blow up an image ** Unchanged: [[Image:xyz.jpg|200px]] still blows up an image --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index fe952aa913..c6ec6488a3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -173,6 +173,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Ensure that rate-limiting is applied to rollbacks. * Make a better rate-limiting error message (i.e. a normal MW error, rather than an "Internal Server Error"). +* Do not present an image bigger than the source when 'frameless' option is used + (to be consistent with the 'thumb' option now) == Parser changes in 1.12 == diff --git a/includes/Linker.php b/includes/Linker.php index 94f6b05c10..9e38a41f42 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -555,6 +555,15 @@ class Linker { return $prefix.$this->makeThumbLink2( $title, $file, $fp, $hp ).$postfix; } + if ( $file && isset( $fp['frameless'] ) ) { + $srcWidth = $file->getWidth( $page ); + # For "frameless" option: do not present an image bigger than the source (for bitmap-style images) + # This is the same behaviour as the "thumb" option does it already. + if ( $srcWidth && !$file->mustRender() && $hp['width'] > $srcWidth ) { + $hp['width'] = $srcWidth; + } + } + if ( $file && $hp['width'] ) { # Create a resized image, without the additional thumbnail features $thumb = $file->transform( $hp ); @@ -1379,7 +1388,3 @@ class Linker { return $out; } } - - - -