http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88129

Revision: 88129
Author:   bawolff
Date:     2011-05-14 23:48:59 +0000 (Sat, 14 May 2011)
Log Message:
-----------
(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

Modified Paths:
--------------
    trunk/phase3/RELEASE-NOTES-1.19
    trunk/phase3/includes/Linker.php

Modified: trunk/phase3/RELEASE-NOTES-1.19
===================================================================
--- trunk/phase3/RELEASE-NOTES-1.19     2011-05-14 23:40:20 UTC (rev 88128)
+++ trunk/phase3/RELEASE-NOTES-1.19     2011-05-14 23:48:59 UTC (rev 88129)
@@ -44,6 +44,8 @@
 * (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

Modified: trunk/phase3/includes/Linker.php
===================================================================
--- trunk/phase3/includes/Linker.php    2011-05-14 23:40:20 UTC (rev 88128)
+++ trunk/phase3/includes/Linker.php    2011-05-14 23:48:59 UTC (rev 88129)
@@ -507,7 +507,14 @@
                        $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;


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to