From: Brion Vibber Date: Sun, 25 Jun 2006 06:23:53 +0000 (+0000) Subject: * Fix display of file-type icons in galleries when $wgIgnoreImageErrors is off X-Git-Tag: 1.31.0-rc.0~56618 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=5808535e167e026effc31a88bd55f3900e96f6b7;p=lhc%2Fweb%2Fwiklou.git * Fix display of file-type icons in galleries when $wgIgnoreImageErrors is off --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index a9bbcb6443..22848d919c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -562,6 +562,8 @@ Some default configuration options have changed: * Improve default blank content of MediaWiki:Common.css and MediaWiki:Monobook.css * (bug 6434) Allow customisation of submit button text on Special:Export * (bug 6314) Add user tool links on page histories +* Fix display of file-type icons in galleries when $wgIgnoreImageErrors is off + == Compatibility == diff --git a/includes/Image.php b/includes/Image.php index a0436261f0..16fc55b5ca 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -882,6 +882,8 @@ class Image * provide access to the actual file, the real size of the thumb, * and can produce a convenient tag for you. * + * For non-image formats, this may return a filetype-specific icon. + * * @param integer $width maximum width of the generated thumbnail * @param integer $height maximum height of the image (optional) * @return ThumbnailImage or null on failure @@ -896,11 +898,11 @@ class Image if ($this->canRender()) { if ( $width > $this->width * $height / $this->height ) $width = wfFitBoxWidth( $this->width, $this->height, $height ); - $thumb = $this->renderThumb( $width ); + return $this->renderThumb( $width ); + } else { + // not a bitmap or renderable image, don't try. + return $this->iconThumb(); } - else $thumb= NULL; #not a bitmap or renderable image, don't try. - - return $thumb; } /** diff --git a/includes/ImageGallery.php b/includes/ImageGallery.php index ccf2c146f7..001305fa36 100644 --- a/includes/ImageGallery.php +++ b/includes/ImageGallery.php @@ -184,9 +184,6 @@ class ImageGallery $s .= ($i%4==0) ? '' : ''; $thumb = $img->getThumbnail( 120, 120 ); - if ( !$thumb && $wgIgnoreImageErrors ) { - $thumb = $img->iconThumb(); - } if ( $thumb ) { $vpad = floor( ( 150 - $thumb->height ) /2 ) - 2; $s .= '
' . '
';