r25916 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25915‎ | r25916 | r25917 >
Date:13:24, 18 September 2007
Author:raymond
Status:old
Tags:
Comment:
Moving code from Linker::makeThumbLink2 to Linker::makeImageLink2
This will prevent bigger images than the source (for bitmap-style images)
[[Image:smallIconWith25px.png|200px]] does not blow the bitmap to 200px width
Now the same behavior as [[Image:smallIconWith25px.png|thumb|200px]] which prevents blow up already.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Linker.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Linker.php
@@ -544,6 +544,15 @@
545545 }
546546 }
547547
 548+ if ( $file && $hp['width'] ) {
 549+ # Do not present an image bigger than the source, for bitmap-style images
 550+ # This is a hack to maintain compatibility with arbitrary pre-1.10 behaviour
 551+ $srcWidth = $file->getWidth( $page );
 552+ if ( $srcWidth && !$file->mustRender() && $hp['width'] > $srcWidth ) {
 553+ $hp['width'] = $srcWidth;
 554+ }
 555+ }
 556+
548557 if ( isset( $fp['thumbnail'] ) || isset( $fp['manualthumb'] ) || isset( $fp['framed'] ) ) {
549558
550559 # Create a thumbnail. Alignment depends on language
@@ -634,12 +643,6 @@
635644 // Use image dimensions, don't scale
636645 $thumb = $file->getUnscaledThumb( $page );
637646 } else {
638 - # Do not present an image bigger than the source, for bitmap-style images
639 - # This is a hack to maintain compatibility with arbitrary pre-1.10 behaviour
640 - $srcWidth = $file->getWidth( $page );
641 - if ( $srcWidth && !$file->mustRender() && $hp['width'] > $srcWidth ) {
642 - $hp['width'] = $srcWidth;
643 - }
644647 $thumb = $file->transform( $hp );
645648 }
646649
@@ -1373,7 +1376,3 @@
13741377 return $out;
13751378 }
13761379 }
1377 -
1378 -
1379 -
1380 -
Index: trunk/phase3/RELEASE-NOTES
@@ -59,6 +59,7 @@
6060 * Strike the link to the redirect rather than using an asterisk in Special:Listredirects
6161 * (bug 11355) Fix false positives in Safe Mode and other config detection
6262 when boolean settings are disabled with 'Off' via php_admin_value/php_value
 63+* Do not present an image bigger than the source, for bitmap-style images
6364
6465 === API changes in 1.12 ===
6566

Follow-up revisions

RevisionCommit summaryAuthorDate
r25917Revert r25916 -- breaks ability to blow up small images, without explanation....brion14:30, 18 September 2007
r25932Merged revisions 25861-25931 via svnmerge from...david06:43, 19 September 2007

Status & tagging log