Index: branches/REL1_17/phase3/includes/media/SVG.php |
— | — | @@ -49,14 +49,23 @@ |
50 | 50 | if ( !parent::normaliseParams( $image, $params ) ) { |
51 | 51 | return false; |
52 | 52 | } |
53 | | - # Don't make an image bigger than wgMaxSVGSize |
| 53 | + # Don't make an image bigger than wgMaxSVGSize on the smaller side |
54 | 54 | $params['physicalWidth'] = $params['width']; |
55 | 55 | $params['physicalHeight'] = $params['height']; |
56 | | - if ( $params['physicalWidth'] > $wgSVGMaxSize ) { |
57 | | - $srcWidth = $image->getWidth( $params['page'] ); |
58 | | - $srcHeight = $image->getHeight( $params['page'] ); |
59 | | - $params['physicalWidth'] = $wgSVGMaxSize; |
60 | | - $params['physicalHeight'] = File::scaleHeight( $srcWidth, $srcHeight, $wgSVGMaxSize ); |
| 56 | + if ( $params['physicalWidth'] <= $params['physicalHeight'] ) { |
| 57 | + if ( $params['physicalWidth'] > $wgSVGMaxSize ) { |
| 58 | + $srcWidth = $image->getWidth( $params['page'] ); |
| 59 | + $srcHeight = $image->getHeight( $params['page'] ); |
| 60 | + $params['physicalWidth'] = $wgSVGMaxSize; |
| 61 | + $params['physicalHeight'] = File::scaleHeight( $srcWidth, $srcHeight, $wgSVGMaxSize ); |
| 62 | + } |
| 63 | + } else { |
| 64 | + if ( $params['physicalHeight'] > $wgSVGMaxSize ) { |
| 65 | + $srcWidth = $image->getWidth( $params['page'] ); |
| 66 | + $srcHeight = $image->getHeight( $params['page'] ); |
| 67 | + $params['physicalWidth'] = File::scaleHeight( $srcHeight, $srcWidth, $wgSVGMaxSize ); |
| 68 | + $params['physicalHeight'] = $wgSVGMaxSize; |
| 69 | + } |
61 | 70 | } |
62 | 71 | return true; |
63 | 72 | } |
Index: branches/REL1_17/phase3/RELEASE-NOTES |
— | — | @@ -50,6 +50,8 @@ |
51 | 51 | title is given, instead of a URL. |
52 | 52 | * (bug 19514) Unordered list list-style-image should be IE6-compatible (8-bit). |
53 | 53 | * Installer checked for magic_quotes_runtime instead of register_globals. |
| 54 | +* $wgSVGMaxSize is now applied to the smaller of width or height, making very |
| 55 | + wide pano/timeline/diagram SVGs renderable at saner sizes |
54 | 56 | |
55 | 57 | === Changes since 1.17.0rc1 === |
56 | 58 | |