Index: branches/REL1_18/phase3/RELEASE-NOTES-1.18 |
— | — | @@ -422,6 +422,7 @@ |
423 | 423 | tries to subsribe to mediawiki-announce |
424 | 424 | * Installer checked for magic_quotes_runtime instead of register_globals. |
425 | 425 | * (bug 30131) XCache with variable caching disabled no longer used for variable caching (CACHE_ACCEL) |
| 426 | +* $wgSVGMaxSize is now applied to the smaller of width or height, making very wide pano/timeline/diagram SVGs renderable at saner sizes |
426 | 427 | |
427 | 428 | === API changes in 1.18 === |
428 | 429 | * BREAKING CHANGE: action=watch now requires POST and token. |
Index: branches/REL1_18/phase3/includes/media/SVG.php |
— | — | @@ -58,12 +58,21 @@ |
59 | 59 | if ( !parent::normaliseParams( $image, $params ) ) { |
60 | 60 | return false; |
61 | 61 | } |
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 | + } |
68 | 77 | } |
69 | 78 | return true; |
70 | 79 | } |