From 64e90836526c269b3be6f8f00be59dd05daf9277 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 18 Sep 2007 14:30:40 +0000 Subject: [PATCH] Revert r25916 -- breaks ability to blow up small images, without explanation. WTF? --- RELEASE-NOTES | 1 - includes/Linker.php | 19 ++++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index fa9957c2f8..5a9945a68c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -59,7 +59,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Strike the link to the redirect rather than using an asterisk in Special:Listredirects * (bug 11355) Fix false positives in Safe Mode and other config detection when boolean settings are disabled with 'Off' via php_admin_value/php_value -* Do not present an image bigger than the source, for bitmap-style images === API changes in 1.12 === diff --git a/includes/Linker.php b/includes/Linker.php index 0836cf5ead..9397b80055 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -544,15 +544,6 @@ class Linker { } } - if ( $file && $hp['width'] ) { - # Do not present an image bigger than the source, for bitmap-style images - # This is a hack to maintain compatibility with arbitrary pre-1.10 behaviour - $srcWidth = $file->getWidth( $page ); - if ( $srcWidth && !$file->mustRender() && $hp['width'] > $srcWidth ) { - $hp['width'] = $srcWidth; - } - } - if ( isset( $fp['thumbnail'] ) || isset( $fp['manualthumb'] ) || isset( $fp['framed'] ) ) { # Create a thumbnail. Alignment depends on language @@ -643,6 +634,12 @@ class Linker { // Use image dimensions, don't scale $thumb = $file->getUnscaledThumb( $page ); } else { + # Do not present an image bigger than the source, for bitmap-style images + # This is a hack to maintain compatibility with arbitrary pre-1.10 behaviour + $srcWidth = $file->getWidth( $page ); + if ( $srcWidth && !$file->mustRender() && $hp['width'] > $srcWidth ) { + $hp['width'] = $srcWidth; + } $thumb = $file->transform( $hp ); } @@ -1376,3 +1373,7 @@ class Linker { return $out; } } + + + + -- 2.20.1