Collapse some nested if statements
[lhc/web/wiklou.git] / includes / media / BitmapHandler.php
index e2d32cf..f003554 100644 (file)
@@ -91,7 +91,7 @@ class BitmapHandler extends TransformationalImageHandler {
         * @param array &$params
         * @return bool
         */
-       function normaliseParams( $image, &$params ) {
+       public function normaliseParams( $image, &$params ) {
                global $wgMaxInterlacingAreas;
                if ( !parent::normaliseParams( $image, $params ) ) {
                        return false;
@@ -338,10 +338,8 @@ class BitmapHandler extends TransformationalImageHandler {
                        }
                        $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 ) ) {