Fix #bug 2460: <img> width & height now properly filled when resizing image
authorAntoine Musso <hashar@users.mediawiki.org>
Mon, 27 Jun 2005 02:18:45 +0000 (02:18 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Mon, 27 Jun 2005 02:18:45 +0000 (02:18 +0000)
RELEASE-NOTES
includes/Linker.php

index 760f396..3c23173 100644 (file)
@@ -376,6 +376,7 @@ Various bugfixes, small features, and a few experimental things:
 * (bug 1242) category list now show on edit page
 * Skip sidebar entries where link text is '-'
 * Convert non-UTF-8 URL parameters even if referer is local
+* (bug 2460) <img> width & height properly filled when resizing image
 
 
 === Caveats ===
index ed7c6c9..fbecbd9 100644 (file)
@@ -419,7 +419,9 @@ class Linker {
                                $width = $img->getWidth() * $height / $img->getHeight();
                        }
                        if ( '' == $manual_thumb ) {
-                               $url = $img->createThumb( $width );
+                               $thumb = $img->getThumbnail( $width );
+                               $height = $thumb->height;
+                               $url = $thumb->getUrl( );
                        }
                }
 
@@ -429,7 +431,9 @@ class Linker {
                        //$s .= "<br />{$alt}<br />{$url}<br />\n";
                } else {
                        $s = '<a href="'.$u.'" class="image" title="'.$alt.'">' .
-                                '<img src="'.$url.'" alt="'.$alt.'" longdesc="'.$u.'" /></a>';
+                                '<img src="'.$url.'" alt="'.$alt.'" ' .
+                                'width="'.$width.'" height="'.$height.'" ' .
+                                'longdesc="'.$u.'" /></a>';
                }
                if ( '' != $align ) {
                        $s = "<div class=\"float{$align}\"><span>{$s}</span></div>";