r9905 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r9904‎ | r9905 | r9906 >
Date:19:20, 4 July 2005
Author:vibber
Status:old
Tags:
Comment:
* (bug 2632) Fix proportional image scaling, giving correct height
* (bug 2640) Include width and height attributes on unscaled images
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Linker.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Linker.php
@@ -377,6 +377,8 @@
378378 $url = $img->getViewURL();
379379 $prefix = $postfix = '';
380380
 381+ wfDebug( "makeImageLinkObj: '$width'x'$height'\n" );
 382+
381383 if ( 'center' == $align )
382384 {
383385 $prefix = '<div class="center">';
@@ -421,13 +423,24 @@
422424 if ( $manual_thumb == '') {
423425 $thumb = $img->getThumbnail( $width );
424426 if ( $thumb ) {
425 - // $height = $thumb->height;
426 - $height = floor($thumb->height * $width / $img->width);
427 - $url = $thumb->getUrl( );
 427+ if( $width > $thumb->width ) {
 428+ // Requested a display size larger than the actual image;
 429+ // fake it up!
 430+ $height = floor($thumb->height * $width / $thumb->width);
 431+ wfDebug( "makeImageLinkObj: client-size height set to '$height'\n" );
 432+ } else {
 433+ $height = $thumb->height;
 434+ wfDebug( "makeImageLinkObj: thumb height set to '$height'\n" );
 435+ }
 436+ $url = $thumb->getUrl();
428437 }
429438 }
 439+ } else {
 440+ $width = $img->width;
 441+ $height = $img->height;
430442 }
431443
 444+ wfDebug( "makeImageLinkObj2: '$width'x'$height'\n" );
432445 $u = $nt->escapeLocalURL();
433446 if ( $url == '' ) {
434447 $s = $this->makeBrokenImageLinkObj( $img->getTitle() );
Index: trunk/phase3/RELEASE-NOTES
@@ -464,9 +464,10 @@
465465 * (bug 923) Fix title and subtitle for rclinked special page
466466 * (bug 2642) watchdetails message in several languages used <a></a> instead of [ ]
467467 * (bug 2181) basic CSB language localisation by Tomasz G. Sienicki (thanks for the patch)
468 -* (bug 2632) also adjust height when zooming an image by giving only width
469468 * Fix correct use of escaping in edit toolbar bits
470469 * Removed language conversion support from Icelandic
 470+* (bug 2632) Fix proportional image scaling, giving correct height
 471+* (bug 2640) Include width and height attributes on unscaled images
471472
472473
473474 === Caveats ===

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r9888Fixes bug #2632 : new image height when zooming without using "thumb" was not...hashar00:15, 4 July 2005

Status & tagging log