Repair makeThumbLink2() getUnscaledThumb() to pass along the handlerparams to transform()

Fixes bug 23577
This commit is contained in:
Derk-Jan Hartman 2010-05-19 00:40:48 +00:00
parent 9d0292de51
commit f054c4e58f
2 changed files with 7 additions and 12 deletions

View file

@ -594,14 +594,14 @@ class Linker {
if( $manual_title ) {
$manual_img = wfFindFile( $manual_title );
if ( $manual_img ) {
$thumb = $manual_img->getUnscaledThumb();
$thumb = $manual_img->getUnscaledThumb( $hp );
} else {
$exists = false;
}
}
} elseif ( isset( $fp['framed'] ) ) {
// Use image dimensions, don't scale
$thumb = $file->getUnscaledThumb( $page );
$thumb = $file->getUnscaledThumb( $hp );
} else {
# Do not present an image bigger than the source, for bitmap-style images
# This is a hack to maintain compatibility with arbitrary pre-1.10 behaviour

View file

@ -438,20 +438,15 @@ abstract class File {
/**
* Get a ThumbnailImage which is the same size as the source
*/
function getUnscaledThumb( $page = false ) {
function getUnscaledThumb( $handlerParams = array() ) {
$hp =& $handlerParams;
$page = isset( $hp['page'] ) ? $hp['page'] : false;
$width = $this->getWidth( $page );
if ( !$width ) {
return $this->iconThumb();
}
if ( $page ) {
$params = array(
'page' => $page,
'width' => $this->getWidth( $page )
);
} else {
$params = array( 'width' => $this->getWidth() );
}
return $this->transform( $params );
$hp['width'] = $width;
return $this->transform( $hp );
}
/**