From 7f484c8cf014f0672d899a73cf6036167d81a990 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Tue, 4 Jul 2006 18:04:28 +0000 Subject: [PATCH] Fixed flow control in Image::getThumbnail() --- includes/Image.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/includes/Image.php b/includes/Image.php index 6f510f92ee..f9fee3d14f 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -886,14 +886,13 @@ class Image * @public */ function getThumbnail( $width, $height=-1 ) { - if ( $height <= 0 ) { - return $this->renderThumb( $width ); - } - $this->load(); - if ($this->canRender()) { - if ( $width > $this->width * $height / $this->height ) - $width = wfFitBoxWidth( $this->width, $this->height, $height ); + if ( $height > 0 ) { + $this->load(); + if ( $width > $this->width * $height / $this->height ) { + $width = wfFitBoxWidth( $this->width, $this->height, $height ); + } + } return $this->renderThumb( $width ); } else { // not a bitmap or renderable image, don't try. -- 2.20.1