jenkins-bot has submitted this change and it was merged.

Change subject: Fixes for e288e4036
......................................................................


Fixes for e288e4036

Changed static calls to instance functions.

Make BitmapHandler::rotate() non-static.

We don't have a Bitmap class. It should have
been falling back to BitmapHandler class.
(JpegHandler ← ExifBitmapHandler ← BitmapHandler)

Change-Id: I17be410456b00cef2ded8d6e2282ae0de4785695
---
M includes/api/ApiImageRotate.php
M includes/media/Bitmap.php
M includes/media/ExifBitmap.php
M includes/media/Jpeg.php
4 files changed, 13 insertions(+), 13 deletions(-)

Approvals:
  Anomie: Looks good to me, approved
  devunt: Looks good to me, but someone else must approve
  J: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/api/ApiImageRotate.php b/includes/api/ApiImageRotate.php
index 3815d41..80a8078 100644
--- a/includes/api/ApiImageRotate.php
+++ b/includes/api/ApiImageRotate.php
@@ -134,7 +134,7 @@
         */
        private function getPageSet() {
                if ( $this->mPageSet === null ) {
-                       $this->mPageSet = new ApiPageSet( $this, 0, NS_FILE);
+                       $this->mPageSet = new ApiPageSet( $this, 0, NS_FILE );
                }
                return $this->mPageSet;
        }
diff --git a/includes/media/Bitmap.php b/includes/media/Bitmap.php
index 0ad862d..c31c46b 100644
--- a/includes/media/Bitmap.php
+++ b/includes/media/Bitmap.php
@@ -634,7 +634,7 @@
                # Escape glob chars
                $path = preg_replace( '/[*?\[\]{}]/', '\\\\\0', $path );
 
-               return self::escapeMagickPath( $path, $scene );
+               return $this->escapeMagickPath( $path, $scene );
        }
 
        /**
@@ -644,7 +644,7 @@
         */
        function escapeMagickOutput( $path, $scene = false ) {
                $path = str_replace( '%', '%%', $path );
-               return self::escapeMagickPath( $path, $scene );
+               return $this->escapeMagickPath( $path, $scene );
        }
 
        /**
@@ -762,26 +762,26 @@
         * @since 1.21
         * @return bool
         */
-       public static function rotate( $file, $params ) {
+       public function rotate( $file, $params ) {
                global $wgImageMagickConvertCommand;
 
-               $rotation = ( $params[ 'rotation' ] + self::getRotation( $file 
) ) % 360;
+               $rotation = ( $params[ 'rotation' ] + $this->getRotation( $file 
) ) % 360;
                $scene = false;
 
                $scaler = self::getScalerType( null, false );
                switch ( $scaler ) {
                        case 'im':
                                $cmd = wfEscapeShellArg( 
$wgImageMagickConvertCommand ) . " " .
-                                       wfEscapeShellArg( 
self::escapeMagickInput( $params[ 'srcPath' ], $scene ) ) .
+                                       wfEscapeShellArg( 
$this->escapeMagickInput( $params[ 'srcPath' ], $scene ) ) .
                                        " -rotate -$rotation " .
-                                       wfEscapeShellArg( 
self::escapeMagickOutput( $params[ 'dstPath' ] ) ) . " 2>&1";
+                                       wfEscapeShellArg( 
$this->escapeMagickOutput( $params[ 'dstPath' ] ) ) . " 2>&1";
                                wfDebug( __METHOD__ . ": running ImageMagick: 
$cmd\n" );
                                wfProfileIn( 'convert' );
                                $retval = 0;
                                $err = wfShellExec( $cmd, $retval, $env );
                                wfProfileOut( 'convert' );
                                if ( $retval !== 0 ) {
-                                       self::logErrorForExternalProcess( 
$retval, $err, $cmd );
+                                       $this->logErrorForExternalProcess( 
$retval, $err, $cmd );
                                        return new MediaTransformError( 
'thumbnail_error', 0, 0, $err );
                                }
                                return false;
diff --git a/includes/media/ExifBitmap.php b/includes/media/ExifBitmap.php
index 1a761f3..1671ab2 100644
--- a/includes/media/ExifBitmap.php
+++ b/includes/media/ExifBitmap.php
@@ -190,7 +190,7 @@
                }
 
                $data = $file->getMetadata();
-               return self::getRotationForExif( $data );
+               return $this->getRotationForExif( $data );
        }
 
        /**
diff --git a/includes/media/Jpeg.php b/includes/media/Jpeg.php
index cd6f18c..355cab3 100644
--- a/includes/media/Jpeg.php
+++ b/includes/media/Jpeg.php
@@ -66,10 +66,10 @@
         * @since 1.21
         * @return bool
         */
-       public static function rotate( $file, $params ) {
+       public function rotate( $file, $params ) {
                global $wgJpegTran;
 
-               $rotation = ( $params[ 'rotation' ] + self::getRotation( $file 
) ) % 360;
+               $rotation = ( $params[ 'rotation' ] + $this->getRotation( $file 
) ) % 360;
 
                if( $wgJpegTran && is_file( $wgJpegTran ) ){
                        $cmd = wfEscapeShellArg( $wgJpegTran ) .
@@ -82,12 +82,12 @@
                                $err = wfShellExec( $cmd, $retval, $env );
                                wfProfileOut( 'jpegtran' );
                        if ( $retval !== 0 ) {
-                               self::logErrorForExternalProcess( $retval, 
$err, $cmd );
+                               $this->logErrorForExternalProcess( $retval, 
$err, $cmd );
                                return new MediaTransformError( 
'thumbnail_error', 0, 0, $err );
                        }
                        return false;
                } else {
-                       return Bitmap::rotate( $file, $params );
+                       return parent::rotate( $file, $params );
                }
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/52788
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I17be410456b00cef2ded8d6e2282ae0de4785695
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Platonides <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: J <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: devunt <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to