From: Brian Wolff Date: Sat, 14 May 2011 23:48:59 +0000 (+0000) Subject: (bug 28940) When making a thumb of an SVG, and only specifying the height X-Git-Tag: 1.31.0-rc.0~30177 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/?a=commitdiff_plain;h=cde9145e66d72bd9ecd9ed6f19164149ef647590;p=lhc%2Fweb%2Fwiklou.git (bug 28940) When making a thumb of an SVG, and only specifying the height make the width be the max SVG size, not the natrual width of the SVG. Some of the linker code here should perhaps be moved. See comments on bug 28940 --- diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 64afe59168..436cceab0d 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -44,6 +44,8 @@ used in Tiff files. * (bug 11868) If using links to count articles, the checking will now be based on the real presence of an internal link instead of the "[[" string * (bug 28287) The "your changes" box for edit conflicts is now read-only. +* (bug 28940) When making a thumb of an SVG, and only specifying the height + make the width be the max SVG size, not the natrual width of the SVG. === API changes in 1.19 === * (bug 27790) add query type for querymodules to action=paraminfo diff --git a/includes/Linker.php b/includes/Linker.php index fd0b48ade0..3eaede6315 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -507,7 +507,14 @@ class Linker { $fp['align'] = 'none'; } if ( $file && !isset( $hp['width'] ) ) { - $hp['width'] = $file->getWidth( $page ); + if ( isset( $hp['height'] ) && $file->isVectorized() ) { + // If its a vector image, and user only specifies height + // we don't want it to be limited by its "normal" width. + global $wgSVGMaxSize; + $hp['width'] = $wgSVGMaxSize; + } else { + $hp['width'] = $file->getWidth( $page ); + } if ( isset( $fp['thumbnail'] ) || isset( $fp['framed'] ) || isset( $fp['frameless'] ) || !$hp['width'] ) { global $wgThumbLimits, $wgThumbUpright;