From d0eb624a71c82354fd484b5910aa25f03f7c5ac8 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Mon, 4 Jul 2005 00:15:35 +0000 Subject: [PATCH] Fixes bug #2632 : new image height when zooming without using "thumb" was not computed. --- RELEASE-NOTES | 2 ++ includes/Linker.php | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index ecd1a47929..ef3f97c8fa 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -462,6 +462,8 @@ of MediaWiki:Newpagetext) to &action=edit, if page is new. * (bug 923) Fix title and subtitle for rclinked special page * (bug 2642) watchdetails message in several languages used instead of [ ] * (bug 2181) basic CSB language localisation by Tomasz G. Sienicki (thanks for the patch) +* (bug 2632) also adjust height when zooming an image by giving only width + === Caveats === diff --git a/includes/Linker.php b/includes/Linker.php index c174573653..47a66dc18e 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -418,10 +418,11 @@ class Linker { if ( $height !== false && ( $img->getHeight() * $width / $img->getWidth() > $height ) ) { $width = $img->getWidth() * $height / $img->getHeight(); } - if ( '' == $manual_thumb ) { + if ( $manual_thumb == '') { $thumb = $img->getThumbnail( $width ); if ( $thumb ) { - $height = $thumb->height; + // $height = $thumb->height; + $height = floor($thumb->height * $width / $img->width); $url = $thumb->getUrl( ); } } -- 2.20.1