$path = '/common/images/icons/' . $icon;
$filepath = $wgStyleDirectory . $path;
if ( file_exists( $filepath ) ) { // always FS
- return new ThumbnailImage( $this, $wgStylePath . $path, 120, 120 );
+ $params = array( 'width' => 120, 'height' => 120 );
+ return new ThumbnailImage( $this, $wgStylePath . $path, false, $params );
}
}
return null;
if ( $flags & self::TRANSFORM_LATER ) {
wfDebug( __METHOD__ . ": Transforming later per flags.\n" );
- return new ThumbnailImage( $image, $dstUrl, $scalerParams['clientWidth'],
- $scalerParams['clientHeight'], false );
+ $params = array(
+ 'width' => $scalerParams['clientWidth'],
+ 'height' => $scalerParams['clientHeight']
+ );
+ return new ThumbnailImage( $image, $dstUrl, false, $params );
}
# Try to make a target path for the thumbnail
} elseif ( $mto ) {
return $mto;
} else {
- return new ThumbnailImage( $image, $dstUrl, $scalerParams['clientWidth'],
- $scalerParams['clientHeight'], $dstPath );
+ $params = array(
+ 'width' => $scalerParams['clientWidth'],
+ 'height' => $scalerParams['clientHeight']
+ );
+ return new ThumbnailImage( $image, $dstUrl, $dstPath, $params );
}
}
* client side
*
* @param $image File File associated with this thumbnail
- * @param $params array Array with scaler params
+ * @param $scalerParams array Array with scaler params
* @return ThumbnailImage
*
* @todo fixme: no rotation support
*/
- protected function getClientScalingThumbnailImage( $image, $params ) {
- return new ThumbnailImage( $image, $image->getURL(),
- $params['clientWidth'], $params['clientHeight'], null );
+ protected function getClientScalingThumbnailImage( $image, $scalerParams ) {
+ $params = array(
+ 'width' => $scalerParams['clientWidth'],
+ 'height' => $scalerParams['clientHeight']
+ );
+ return new ThumbnailImage( $image, $image->getURL(), null, $params );
}
/**
if ( !$this->normaliseParams( $image, $params ) ) {
return new TransformParameterError( $params );
}
- return new ThumbnailImage( $image, $image->getURL(), $params['width'],
- $params['height'], $image->getLocalRefPath() );
+ return new ThumbnailImage( $image, $image->getURL(), $image->getLocalRefPath(), $params );
}
}
}
if ( $flags & self::TRANSFORM_LATER ) {
- return new ThumbnailImage( $image, $dstUrl, $width, $height, $dstPath, $page );
+ $params = array(
+ 'width' => $width,
+ 'height' => $height,
+ 'page' => $page
+ );
+ return new ThumbnailImage( $image, $dstUrl, $dstPath, $params );
}
if ( !wfMkdirParents( dirname( $dstPath ), null, __METHOD__ ) ) {
wfHostname(), $retval, trim($err), $cmd ) );
return new MediaTransformError( 'thumbnail_error', $width, $height, $err );
} else {
- return new ThumbnailImage( $image, $dstUrl, $width, $height, $dstPath, $page );
+ $params = array(
+ 'width' => $width,
+ 'height' => $height,
+ 'page' => $page
+ );
+ return new ThumbnailImage( $image, $dstUrl, $dstPath, $params );
}
}
return false;
}
$url = $script . '&' . wfArrayToCGI( $this->getScriptParams( $params ) );
- $page = isset( $params['page'] ) ? $params['page'] : false;
if( $image->mustRender() || $params['width'] < $image->getWidth() ) {
- return new ThumbnailImage( $image,
- $url, $params['width'], $params['height'], false, $page );
+ return new ThumbnailImage( $image, $url, false, $params );
}
}
$physicalHeight = $params['physicalHeight'];
if ( $flags & self::TRANSFORM_LATER ) {
- return new ThumbnailImage( $image, $dstUrl, $clientWidth, $clientHeight, $dstPath );
+ return new ThumbnailImage( $image, $dstUrl, $dstPath, $params );
}
if ( !wfMkdirParents( dirname( $dstPath ), null, __METHOD__ ) ) {
$srcPath = $image->getLocalRefPath();
$status = $this->rasterize( $srcPath, $dstPath, $physicalWidth, $physicalHeight );
if( $status === true ) {
- return new ThumbnailImage( $image, $dstUrl, $clientWidth, $clientHeight, $dstPath );
+ return new ThumbnailImage( $image, $dstUrl, $dstPath, $params );
} else {
return $status; // MediaTransformError
}