r93746 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93745‎ | r93746 | r93747 >
Date:14:13, 2 August 2011
Author:brion
Status:ok
Tags:
Comment:
* $wgSVGMaxSize is now applied to the smaller of width or height, making very wide pano/timeline/diagram SVGs renderable at saner sizes
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.18 (modified) (history)
  • /trunk/phase3/includes/media/SVG.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.18
@@ -433,6 +433,7 @@
434434 param is only present in hash.
435435 * Installer checked for magic_quotes_runtime instead of register_globals.
436436 * (bug 30131) XCache with variable caching disabled no longer used for variable caching (CACHE_ACCEL)
 437+* $wgSVGMaxSize is now applied to the smaller of width or height, making very wide pano/timeline/diagram SVGs renderable at saner sizes
437438
438439 === API changes in 1.18 ===
439440 * BREAKING CHANGE: action=watch now requires POST and token.
Index: trunk/phase3/includes/media/SVG.php
@@ -58,12 +58,21 @@
5959 if ( !parent::normaliseParams( $image, $params ) ) {
6060 return false;
6161 }
62 - # Don't make an image bigger than wgMaxSVGSize
63 - if ( $params['physicalWidth'] > $wgSVGMaxSize ) {
64 - $srcWidth = $image->getWidth( $params['page'] );
65 - $srcHeight = $image->getHeight( $params['page'] );
66 - $params['physicalWidth'] = $wgSVGMaxSize;
67 - $params['physicalHeight'] = File::scaleHeight( $srcWidth, $srcHeight, $wgSVGMaxSize );
 62+ # Don't make an image bigger than wgMaxSVGSize on the smaller side
 63+ if ( $params['physicalWidth'] <= $params['physicalHeight'] ) {
 64+ if ( $params['physicalWidth'] > $wgSVGMaxSize ) {
 65+ $srcWidth = $image->getWidth( $params['page'] );
 66+ $srcHeight = $image->getHeight( $params['page'] );
 67+ $params['physicalWidth'] = $wgSVGMaxSize;
 68+ $params['physicalHeight'] = File::scaleHeight( $srcWidth, $srcHeight, $wgSVGMaxSize );
 69+ }
 70+ } else {
 71+ if ( $params['physicalHeight'] > $wgSVGMaxSize ) {
 72+ $srcWidth = $image->getWidth( $params['page'] );
 73+ $srcHeight = $image->getHeight( $params['page'] );
 74+ $params['physicalWidth'] = File::scaleHeight( $srcHeight, $srcWidth, $wgSVGMaxSize );
 75+ $params['physicalHeight'] = $wgSVGMaxSize;
 76+ }
6877 }
6978 return true;
7079 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r93747MFT r93746 -- change $wgSVGMaxSize handling to be nicer to images that are ve...brion14:16, 2 August 2011
r93749MFT r93746 -- change $wgSVGMaxSize handling to be nicer to images that are ve...brion14:17, 2 August 2011
r93750MFT r93746 -- change $wgSVGMaxSize handling to be nicer to images that are ve...brion14:22, 2 August 2011

Status & tagging log