BC hack for thumbnail sizes
authorTim Starling <tstarling@users.mediawiki.org>
Tue, 1 May 2007 21:30:46 +0000 (21:30 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Tue, 1 May 2007 21:30:46 +0000 (21:30 +0000)
includes/Linker.php

index b12e2ad..82dca04 100644 (file)
@@ -531,6 +531,12 @@ class Linker {
                        // Use image dimensions, don't scale
                        $thumb = $img->getUnscaledThumb( $page );
                } else {
+                       # Do not present an image bigger than the source, for bitmap-style images
+                       # This is a hack to maintain compatibility with arbitrary pre-1.10 behaviour
+                       $srcWidth = $img->getWidth( $page );
+                       if ( $srcWidth && !$img->mustRender() && $params['width'] > $srcWidth ) {
+                               $params['width'] = $srcWidth;
+                       }
                        $thumb = $img->transform( $params );
                }