* @param array &$params
* @return bool
*/
- function normaliseParams( $image, &$params ) {
+ public function normaliseParams( $image, &$params ) {
global $wgMaxInterlacingAreas;
if ( !parent::normaliseParams( $image, $params ) ) {
return false;
$rotation = isset( $params['disableRotation'] ) ? 0 : $this->getRotation( $image );
list( $width, $height ) = $this->extractPreRotationDimensions( $params, $rotation );
- $cmd = call_user_func_array( 'wfEscapeShellArg', array_merge(
+ $cmd = wfEscapeShellArg( ...array_merge(
[ $wgImageMagickConvertCommand ],
$quality,
// Specify white background color, will be used for transparent images
}
$im->setImageDepth( 8 );
- if ( $rotation ) {
- if ( !$im->rotateImage( new ImagickPixel( 'white' ), 360 - $rotation ) ) {
- return $this->getMediaTransformError( $params, "Error rotating $rotation degrees" );
- }
+ if ( $rotation && !$im->rotateImage( new ImagickPixel( 'white' ), 360 - $rotation ) ) {
+ return $this->getMediaTransformError( $params, "Error rotating $rotation degrees" );
}
if ( $this->isAnimatedImage( $image ) ) {
return $this->getMediaTransformError( $params, $errMsg );
}
- $src_image = call_user_func( $loader, $params['srcPath'] );
+ $src_image = $loader( $params['srcPath'] );
$rotation = function_exists( 'imagerotate' ) && !isset( $params['disableRotation'] ) ?
$this->getRotation( $image ) :
if ( $useQuality && isset( $params['quality'] ) ) {
$funcParams[] = $params['quality'];
}
- call_user_func_array( $saveType, $funcParams );
+ $saveType( ...$funcParams );
imagedestroy( $dst_image );
imagedestroy( $src_image );