From: Huji Date: Sun, 2 Mar 2008 22:34:51 +0000 (+0000) Subject: * (bug 13214) doesn't resize images which are smaller than 120*120 X-Git-Tag: 1.31.0-rc.0~49281 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22sites_tous%22%29%20.%20%22?a=commitdiff_plain;h=0bcdeea6a54b67118646d92d636327f120b759ae;p=lhc%2Fweb%2Fwiklou.git * (bug 13214) doesn't resize images which are smaller than 120*120 --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c6ae9bc600..83de22b13a 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -61,6 +61,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 11561) Fix fatal error when calling action=revert to non-image page * (bug 12430) Fix call to private method LinkFilter::makeRegex fatal error in maintenance/cleanupSpam.php +* (bug 13214) doesn't resize images which are smaller than 120*120 === API changes in 1.13 === diff --git a/includes/ImageGallery.php b/includes/ImageGallery.php index 46ecd16959..f0aec768e2 100644 --- a/includes/ImageGallery.php +++ b/includes/ImageGallery.php @@ -235,7 +235,6 @@ class ImageGallery if( $this->mCaption ) $s .= "\n\t{$this->mCaption}"; - $params = array( 'width' => $this->mWidths, 'height' => $this->mHeights ); $i = 0; foreach ( $this->mImages as $pair ) { $nt = $pair[0]; @@ -246,6 +245,12 @@ class ImageGallery wfRunHooks( 'BeforeGalleryFindFile', array( &$this, &$nt, &$time ) ); $img = wfFindFile( $nt, $time ); + + if ( $this->mWidths > $img->getWidth() && $this->mHeights > $img->getHeight() ) { + $params = array( 'width' => $img->getWidth(), 'height' => $img->getHeight() ); + } else { + $params = array( 'width' => $this->mWidths, 'height' => $this->mHeights ); + } if( $nt->getNamespace() != NS_IMAGE || !$img ) { # We're dealing with a non-image, spit out the name and be done with it.