$height = $params['physicalHeight'];
}
- return array( $width, $height );
+ return [ $width, $height ];
}
/**
}
# Create a parameter array to pass to the scaler
- $scalerParams = array(
+ $scalerParams = [
# The size to which the image will be resized
'physicalWidth' => $params['physicalWidth'],
'physicalHeight' => $params['physicalHeight'],
'mimeType' => $image->getMimeType(),
'dstPath' => $dstPath,
'dstUrl' => $dstUrl,
- );
+ 'interlace' => isset( $params['interlace'] ) ? $params['interlace'] : false,
+ ];
if ( isset( $params['quality'] ) && $params['quality'] === 'low' ) {
$scalerParams['quality'] = 30;
if ( $flags & self::TRANSFORM_LATER ) {
wfDebug( __METHOD__ . ": Transforming later per flags.\n" );
- $newParams = array(
+ $newParams = [
'width' => $scalerParams['clientWidth'],
'height' => $scalerParams['clientHeight']
- );
+ ];
if ( isset( $params['quality'] ) ) {
$newParams['quality'] = $params['quality'];
}
# Try a hook. Called "Bitmap" for historical reasons.
/** @var $mto MediaTransformOutput */
$mto = null;
- Hooks::run( 'BitmapHandlerTransform', array( $this, $image, &$scalerParams, &$mto ) );
+ Hooks::run( 'BitmapHandlerTransform', [ $this, $image, &$scalerParams, &$mto ] );
if ( !is_null( $mto ) ) {
wfDebug( __METHOD__ . ": Hook to BitmapHandlerTransform created an mto\n" );
$scaler = 'hookaborted';
} elseif ( $mto ) {
return $mto;
} else {
- $newParams = array(
+ $newParams = [
'width' => $scalerParams['clientWidth'],
'height' => $scalerParams['clientHeight']
- );
+ ];
if ( isset( $params['quality'] ) ) {
$newParams['quality'] = $params['quality'];
}
* @todo FIXME: No rotation support
*/
protected function getClientScalingThumbnailImage( $image, $scalerParams ) {
- $params = array(
+ $params = [
'width' => $scalerParams['clientWidth'],
'height' => $scalerParams['clientHeight']
- );
+ ];
- return new ThumbnailImage( $image, $image->getURL(), null, $params );
+ return new ThumbnailImage( $image, $image->getUrl(), null, $params );
}
/**
$checkImageAreaHookResult = null;
Hooks::run(
'BitmapHandlerCheckImageArea',
- array( $file, &$params, &$checkImageAreaHookResult )
+ [ $file, &$params, &$checkImageAreaHookResult ]
);
if ( !is_null( $checkImageAreaHookResult ) ) {