r17524 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r17523‎ | r17524 | r17525 >
Date:13:23, 10 November 2006
Author:brion
Status:old
Tags:
Comment:
* Approximate height for client-side scaling fallback instead of passing -1 into the HTML output.
height="-1" was getting into the <img> tags for (for example) very large PNGs not thumbnailed server-side due to the max image size limit
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Linker.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Linker.php
@@ -537,6 +537,8 @@
538538 $url = $thumb->getUrl();
539539 } else {
540540 $error = htmlspecialchars( $img->getLastError() );
 541+ // Do client-side scaling...
 542+ $height = intval( $img->getHeight() * $width / $img->getWidth() );
541543 }
542544 }
543545 } else {
@@ -633,6 +635,10 @@
634636 if( $thumbUrl == '' ) {
635637 // Couldn't generate thumbnail? Scale the image client-side.
636638 $thumbUrl = $img->getViewURL();
 639+ if( $boxheight == -1 ) {
 640+ // Approximate...
 641+ $boxheight = intval( $height * $boxwidth / $width );
 642+ }
637643 }
638644 if ( $error ) {
639645 $s .= htmlspecialchars( $error );
Index: trunk/phase3/RELEASE-NOTES
@@ -160,6 +160,8 @@
161161 * Fix regression in Special:Undelete for revisions deleted under MediaWiki 1.4
162162 with compression or legacy encoding
163163 * (bug 6737) Fixes for MySQL 5 schema in strict mode
 164+* Approximate height for client-side scaling fallback instead of passing -1
 165+ into the HTML output.
164166
165167
166168 == Languages updated ==

Follow-up revisions

RevisionCommit summaryAuthorDate
r17607* Sync parserTests expected image results with r17524....nickj09:33, 13 November 2006